[go-nuts] December Blog Post Series

2016-12-02 Thread Damian Gryski
And my first post on writing assembly functions with PeachPy is up now: 
https://blog.gopheracademy.com/advent-2016/peachpy/

This is a quick introduction to a tool I've been using in some of my 
performance work recently. My favourite result so far is speeding up my 
HighwayHash implementation 10x via SSE instructions. Most of my improvements 
are closer to 2x.

Hope you enjoy it!  We have a great lineup this year. I'm really looking 
forward to reading them.

If you want to help with editing, you can watch for the Pull Requests against 
https://github.com/gopheracademy/gopheracademy-web and join the #writing 
channel on the Gophers slack.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Go 1.8 Beta 1 is released

2016-12-02 Thread mark
The last sentence under the Compiler Toolchain heading:

> Compared to the previous release, Go 1.8 is about 15% faster 
.

This would be a little more clear if it said something more like "Compared 
to the previous release, *running go build in *Go 1.8 is about 15% faster."

On Wednesday, November 30, 2016 at 7:40:12 PM UTC-8, Chris Broadfoot wrote:
>
> Hello gophers,
>
> We have just released go1.8beta1, a beta version of Go 1.8.
> It is cut from the master branch at the revision tagged go1.8beta1.
>
> There are no known problems or regressions.
> Please try running production workloads and your unit tests with the new 
> version.
>
> It is important that we find bugs *before* issuing a release candidate.
> The release candidate is planned for the first week of January.
> Your help in testing this beta is invaluable.
>
> Report any problems using the issue tracker:
> https://golang.org/issue/new
>
> You can download binary and source distributions from the usual place:
> https://golang.org/dl/#go1.8beta1
>
> To find out what has changed in Go 1.8, read the draft release notes:
> https://beta.golang.org/doc/go1.8
>
> Documentation for Go 1.8 is available at:
> https://beta.golang.org/
>
> Our goal is to release the final version of Go 1.8 on February 1st.
>
> Cheers,
> Chris
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] EasyProxy,make tcp proxy easy to use.

2016-12-02 Thread Xsank Mar


*EasyProxy*
A simple proxy server.

*Introduction*

+--+   ++
|  client  |<+ ||
+--+ +>+-+<--->|   server   |
   | | ||
+--+   | | ++
|  client  |<->| |
+--+   | |
   | | ++
+--+   |  L  | ||
|  client  |<->|  B  |<--->|   server   |
+--+   |  S  | ||
   | | ++
+--+   | |
|  client  |<->| |
+--+   | | ++
   | | ||
+--++->+-+<--->|   server   |
|  client  |<---+  ||
+--+   ++


As the chart above, easyproxy act as the LBS server. If you meet the 
situation that cannot access some service directly or need a server as a 
gateway, you may use this to proxy. *Usage* 

go get github.com/xsank/EasyProxy 
go run build.go build


   - The sample config is about mysql proxy, so you can access the mysql 
   database actually at backend
   - through the `localhost 9527`, you can easily modify the `default.json` 
   to change the service. Any protocol based on `TCP` would work well such 
   as:mysql, ssh, svn... 
   - For keep simple, easyproxy only support `poll`,`random`,`iphash` 
   strategies, and the default strategy is `poll`,the easyproxy would add more 
   if there is a demand. 
   - Besides, you can `curl localhost:7259/statistic` to get the current 
   connection status. If you want to know more runtime debug info about the 
   proxy, you can `curl http://localhost:7259/debug/pprof` 
    to get more details. 
   - You can change the number of MAX processorsand and the heartbeat time 
   based on your requirements

Link:Github:EasyProxy 


Please let me know if you meet any problems. xsank#foxmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Dynamic linking against individual golang standard libraries

2016-12-02 Thread Parker Evans
Alright, so I played around with this a bit.  It would appear that I can 
actually get pretty far by just compiling the full standard library as 
shared and then compiling the individual packages one at a time in the 
proper order.  What I am doing is captured in the program in this 
repository: https://github.com/ermergerd/go-dynlib

However, I hit a couple snags before I got all of the packages compiling 
(thus some are commented out in the application).  Specifically, I see the 
following linker panics when compiling log/syslog and crypto/ecdsa:

2016/12/02 22:05:56 Building package: log/syslog

2016/12/02 22:05:56 # 
/var/folders/5y/90kqcw0j72bgyj0kgxl1rnc4gn/T/go-build689781855/liblog-syslog.so

panic: runtime error: index out of range


goroutine 1 [running]:

panic(0x19fa60, 0xc42000e130)

/Users/Parker/go1.7/src/runtime/panic.go:500 +0x1a1

cmd/link/internal/ld.(*deadcodepass).flood(0xc42003bcd0)

/Users/Parker/go1.7/src/cmd/link/internal/ld/deadcode.go:279 +0xe88

cmd/link/internal/ld.deadcode(0xc42048a000)

/Users/Parker/go1.7/src/cmd/link/internal/ld/deadcode.go:60 +0xe1

cmd/link/internal/ld.Ldmain()

/Users/Parker/go1.7/src/cmd/link/internal/ld/pobj.go:192 +0x1089

cmd/link/internal/arm.Main()

/Users/Parker/go1.7/src/cmd/link/internal/arm/obj.go:45 +0x19

main.main()

/Users/Parker/go1.7/src/cmd/link/main.go:30 +0x168

2016/12/02 22:06:05 Building package: crypto/ecdsa

2016/12/02 22:06:05 # 
/var/folders/5y/90kqcw0j72bgyj0kgxl1rnc4gn/T/go-build010152613/libcrypto-ecdsa.so

panic: runtime error: index out of range


goroutine 1 [running]:

panic(0x19fa60, 0xc42000e130)

/Users/Parker/go1.7/src/runtime/panic.go:500 +0x1a1

cmd/link/internal/ld.(*deadcodepass).flood(0xc4204afcd0)

/Users/Parker/go1.7/src/cmd/link/internal/ld/deadcode.go:279 +0xe88

cmd/link/internal/ld.deadcode(0xc42049e000)

/Users/Parker/go1.7/src/cmd/link/internal/ld/deadcode.go:60 +0xe1

cmd/link/internal/ld.Ldmain()

/Users/Parker/go1.7/src/cmd/link/internal/ld/pobj.go:192 +0x1089

cmd/link/internal/arm.Main()

/Users/Parker/go1.7/src/cmd/link/internal/arm/obj.go:45 +0x19

main.main()

/Users/Parker/go1.7/src/cmd/link/main.go:30 +0x168


For reference, I am cross compiling the libraries to run on an ARM/Linux 
platform with the following command line:

CC=arm-linux-gnueabihf-gcc GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 
./go-dynlibs -ldflags="-w -s -extld=arm-linux-gnueabihf-gcc"


Any thoughts on this method of doing things or the linker panics that I see 
for a couple of the packages?  I was a little confused why I needed to 
compile the full libstd.so before I could make any progress with building 
the individual packages as buildmode shared/linkshared.

Thanks,
Parker

On Tuesday, November 22, 2016 at 9:50:21 PM UTC-5, Parker Evans wrote:
>
> Alright, I will take a look.  Thanks for the response.
>
> ~Parker
>
> On Monday, November 21, 2016 at 7:00:01 PM UTC-5, Ian Lance Taylor wrote:
>>
>> On Sun, Nov 20, 2016 at 1:22 PM, Parker Evans  wrote: 
>> > 
>> > In order to do this kind of thing, do I need to manually figure out 
>> > dependencies and then setup appropriate linker flags? 
>>
>> Yes, pretty much. 
>>
>> It may help a bit to look at go/build/deps_test.go. 
>>
>> Ian 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Downloading go1

2016-12-02 Thread Brad Fitzpatrick
Thanks!


On Fri, Dec 2, 2016 at 4:53 PM, Will Norris  wrote:

> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.darwin-386.pkg
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.darwin-amd64.pkg
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.freebsd-386.tar.gz
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.freebsd-amd64.tar.gz
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.linux-386.tar.gz
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.linux-amd64.tar.gz
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.src.tar.gz
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.windows-386.msi
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.windows-386.zip
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.windows-amd64.msi
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go.go1.windows-amd64.zip
>
> On Fri, Dec 2, 2016 at 4:17 PM, Brad Fitzpatrick 
> wrote:
>
>> I've asked for a list of our objects under that prefix.
>>
>>
>> On Thu, Dec 1, 2016 at 1:56 PM, Edward Muller 
>> wrote:
>>
>>> For $reasons I need to download the original linux amd64 version of go1.
>>>
>>> Older go versions are stored under https://storage.googleapis.com
>>> /google-code-archive-downloads/v2/code.google.com/go/
>>>
>>> I have retrieved go1.0.1 (https://storage.googleapis.co
>>> m/google-code-archive-downloads/v2/code.google.com/go/go1.0.
>>> 1.linux-amd64.tar.gz) and later successfully.
>>>
>>> But I can't seem to find the right key for go1. I've tried:
>>> https://storage.googleapis.com/google-code-archive-downloads
>>> /v2/code.google.com/go/go1.linux-amd64.tar.gz
>>> 
>>> https://storage.googleapis.com/google-code-archive-downloads
>>> /v2/code.google.com/go/go1-linux-amd64.tar.gz
>>> 
>>> https://storage.googleapis.com/google-code-archive-downloads
>>> /v2/code.google.com/go/go1.0.linux-amd64.tar.gz
>>> 
>>> https://storage.googleapis.com/google-code-archive-downloads
>>> /v2/code.google.com/go/go1.0-linux-amd64.tar.gz
>>> 
>>> https://storage.googleapis.com/google-code-archive-downloads
>>> /v2/code.google.com/go/go1.0.0.linux-amd64.tar.gz
>>> 
>>> https://storage.googleapis.com/google-code-archive-downloads
>>> /v2/code.google.com/go/go1.0.0-linux-amd64.tar.gz
>>> 
>>>
>>> All respond with:
>>> >> encoding='UTF-8'?>NoSuchKeyThe
>>> specified key does not exist.
>>>
>>> I've also tried the getting an index (https://storage.googleapis.co
>>> m/google-code-archive-downloads/v2/code.google.com/go
>>> /),
>>> like you can with https://storage.googleapis.com/golang/ (where modern
>>> go releases are stored), but that just returns the same error.
>>>
>>> Can anyone point me to the right https://storage.googleapis.com url for
>>> the go1 release?
>>>
>>> Thanks!
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Downloading go1

2016-12-02 Thread Will Norris
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.darwin-386.pkg
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.darwin-amd64.pkg
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.freebsd-386.tar.gz
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.freebsd-amd64.tar.gz
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.linux-386.tar.gz
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.linux-amd64.tar.gz
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.src.tar.gz
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.windows-386.msi
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.windows-386.zip
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.windows-amd64.msi
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/go/go.go1.windows-amd64.zip

On Fri, Dec 2, 2016 at 4:17 PM, Brad Fitzpatrick 
wrote:

> I've asked for a list of our objects under that prefix.
>
>
> On Thu, Dec 1, 2016 at 1:56 PM, Edward Muller 
> wrote:
>
>> For $reasons I need to download the original linux amd64 version of go1.
>>
>> Older go versions are stored under https://storage.googleapis.com
>> /google-code-archive-downloads/v2/code.google.com/go/
>>
>> I have retrieved go1.0.1 (https://storage.googleapis.co
>> m/google-code-archive-downloads/v2/code.google.com/go/go1.0.
>> 1.linux-amd64.tar.gz) and later successfully.
>>
>> But I can't seem to find the right key for go1. I've tried:
>> https://storage.googleapis.com/google-code-archive-downloads
>> /v2/code.google.com/go/go1.linux-amd64.tar.gz
>> 
>> https://storage.googleapis.com/google-code-archive-downloads
>> /v2/code.google.com/go/go1-linux-amd64.tar.gz
>> 
>> https://storage.googleapis.com/google-code-archive-downloads
>> /v2/code.google.com/go/go1.0.linux-amd64.tar.gz
>> 
>> https://storage.googleapis.com/google-code-archive-downloads
>> /v2/code.google.com/go/go1.0-linux-amd64.tar.gz
>> 
>> https://storage.googleapis.com/google-code-archive-downloads
>> /v2/code.google.com/go/go1.0.0.linux-amd64.tar.gz
>> 
>> https://storage.googleapis.com/google-code-archive-downloads
>> /v2/code.google.com/go/go1.0.0-linux-amd64.tar.gz
>> 
>>
>> All respond with:
>> > encoding='UTF-8'?>NoSuchKeyThe
>> specified key does not exist.
>>
>> I've also tried the getting an index (https://storage.googleapis.co
>> m/google-code-archive-downloads/v2/code.google.com/go
>> /),
>> like you can with https://storage.googleapis.com/golang/ (where modern
>> go releases are stored), but that just returns the same error.
>>
>> Can anyone point me to the right https://storage.googleapis.com url for
>> the go1 release?
>>
>> Thanks!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Downloading go1

2016-12-02 Thread Brad Fitzpatrick
I've asked for a list of our objects under that prefix.


On Thu, Dec 1, 2016 at 1:56 PM, Edward Muller  wrote:

> For $reasons I need to download the original linux amd64 version of go1.
>
> Older go versions are stored under https://storage.googleapis.
> com/google-code-archive-downloads/v2/code.google.com/go/
>
> I have retrieved go1.0.1 (https://storage.googleapis.
> com/google-code-archive-downloads/v2/code.google.com/
> go/go1.0.1.linux-amd64.tar.gz) and later successfully.
>
> But I can't seem to find the right key for go1. I've tried:
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go1.linux-amd64.tar.gz
> 
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go1-linux-amd64.tar.gz
> 
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go1.0.linux-amd64.tar.gz
> 
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go1.0-linux-amd64.tar.gz
> 
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go1.0.0.linux-amd64.tar.gz
> 
> https://storage.googleapis.com/google-code-archive-
> downloads/v2/code.google.com/go/go1.0.0-linux-amd64.tar.gz
> 
>
> All respond with:
> <
> Code>NoSuchKeyThe specified key does not
> exist.
>
> I've also tried the getting an index (https://storage.googleapis.
> com/google-code-archive-downloads/v2/code.google.com/go
> /),
> like you can with https://storage.googleapis.com/golang/ (where modern go
> releases are stored), but that just returns the same error.
>
> Can anyone point me to the right https://storage.googleapis.com url for
> the go1 release?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Is there a formal document explain the package search orders in Golang?

2016-12-02 Thread Ian Lance Taylor
On Fri, Dec 2, 2016 at 11:24 AM, gd  wrote:
> It looks, for the official compiler, if the main package is under GOPATH,
> then the order is:
> 1. the vendor folder
> 2. the standard packages
> 3. GOPATH folder
>
> If the main package is outsides of GOPATH, then the order is:
> 1. the standard packages
> 2. GOPATH folder
> the local vendor folder is totally ignored.
>
> I don't know if this is the well defined behaviour or not.

You can see the defined behavior by running `go help gopath`.  That
will tell you the search path when using the go tool.

If you are not using the go tool, the behavior is different.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: database/sql and custom column types

2016-12-02 Thread scott
A quick aside regarding the code that you posted. Postgres (bizarrely, 
IMHO) stores longitude first, then latitude, so:

 return fmt.Sprintf("POINT(%v %v)", p.Lat, p.Lng)


should be:

 return fmt.Sprintf("POINT(%v %v)", p.Lng, p.Lat)

Thanks for sharing your code!

On Tuesday, February 18, 2014 at 5:29:36 PM UTC-5, Peter Nguyen wrote:
>
> Thanks for all your replies! I managed to create a type that maps to the 
> geography column of Postgis, thanks to this package 
> https://github.com/twpayne/gogeom. Here is the code in case anyone was 
> looking for it:
>
> http://play.golang.org/p/uKXaGvZ2C2
>
> One strange thing is that according to the specification of WKB, the byte 
> for geometry type should be from 1 to 7. But in the code, I had to use 
> uint64 which read to a very large number (18580565393409). It's maybe 
> because of different versions of Postgresq + Postgis, I'm not sure...
>
> Den tisdagen den 18:e februari 2014 kl. 17:58:32 UTC+1 skrev Andy Balholm:
>>
>> On Tuesday, February 18, 2014 3:10:32 AM UTC-8, Peter Nguyen wrote:
>>>
>>> I'm using lib/pg in my project and has now encountered the Postgis 
>>> geography(POINT,4326) column type that I need to both scan into a Point 
>>> struct and also inserting Point structs back to that column. The way to 
>>> insert data into that column type is to call the Postgis function 
>>> ST_GeometryFromText('POINT(-118.4079 33.9434)', 4326). How can this be 
>>> solved using the database/sql package? Is there a way using the provided 
>>> interfaces to map a Point struct into that SQL statement?
>>>
>>
>> If your column type is geography (rather than geometry), it's actually 
>> simpler than that. You can just do something like this:
>>
>> create table test (p geography);
>> insert into test(p) values ('POINT(-118.4079 33.9434)');
>>
>> The ST_GeometryFromText function is unnecessary in this situation. 
>> Virtually every type in Postgres has an input function that accepts a value 
>> formatted as text.
>>
>> On the other hand, when you're scanning a point out of the DB, you do 
>> need to use the ST_AsText function in your query, since the default output 
>> format is a bunch of hexadecimal gibberish.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Is there a formal document explain the package search orders in Golang?

2016-12-02 Thread gd
It looks, for the official compiler, if the main package is under GOPATH, 
then the order is:
1. the vendor folder
2. the standard packages
3. GOPATH folder

If the main package is outsides of GOPATH, then the order is:
1. the standard packages
2. GOPATH folder
the local vendor folder is totally ignored.

I don't know if this is the well defined behaviour or not.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] [ANN] go-diff

2016-12-02 Thread Markus Zimmermann
Hi gophers!

A while ago I took over maintainership of https://github.com/sergi/go-diff 
which is a package to diff, match and patch text. The original code is a 
port of Neil Fraser's google-diff-match-patch by Sergi Mansilla. I am 
almost finished with what I wanted to do when I started this, which is 
refactoring the whole code base to make it more maintainable, and work down 
PRs and open issues.

However, there is still lots that could be done 
[https://github.com/sergi/go-diff/issues]. If somebody wants to help out 
and work on an open source project I would be happy to mentor and review 
your code.

Cheers,
Markus

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: go1.7.4 API check Fail

2016-12-02 Thread gocss
I applied latest updates to ubuntu 14.04 LTS but end with this error: 
(below)
I also see https://github.com/golang/go/issues/18064 ... so I take it I can 
ignore TestLoadFixed Fail
the thing that concerns me is that I don't see any Check API in the output 
from ./all.bash after running ./clean.bash
comments?

ok  text/template/parse0.007s
--- FAIL: TestLoadFixed (0.00s)
time_test.go:943: Now().In(loc).Zone() = "-01", -3600, want "GMT+1", 
-3600
FAIL
FAILtime2.438s
ok  unicode0.007s
ok  unicode/utf160.009s
ok  unicode/utf80.006s
ok  vendor/golang_org/x/net/http2/hpack0.007s
ok  vendor/golang_org/x/net/lex/httplex0.006s
ok  cmd/addr2line0.678s
ok  cmd/asm/internal/asm0.236s
ok  cmd/asm/internal/lex0.010s
ok  cmd/compile/internal/big0.893s
ok  cmd/compile/internal/gc13.667s
ok  cmd/compile/internal/ssa0.320s
ok  cmd/compile/internal/test0.020s
ok  cmd/cover1.368s
ok  cmd/doc0.037s
ok  cmd/fix0.020s
ok  cmd/go37.467s
ok  cmd/gofmt0.042s
ok  cmd/internal/goobj0.020s
ok  cmd/internal/obj0.003s
ok  cmd/internal/obj/x860.015s
ok  cmd/internal/pprof/profile0.005s
ok  cmd/link0.015s
ok  cmd/nm0.787s
ok  cmd/objdump2.214s
ok  cmd/pack2.101s
ok  cmd/vendor/golang.org/x/arch/arm/armasm0.023s
ok  cmd/vendor/golang.org/x/arch/x86/x86asm0.263s
ok  cmd/vet2.795s
ok  cmd/vet/internal/cfg0.005s
2016/12/02 12:24:28 Failed: exit status 1
root@csspc-base:/csspc/etc/go/src# 

On Friday, December 2, 2016 at 11:04:12 AM UTC-5, gocss wrote:
>
> during ./all.bash
> # ../test
>
> # API check
> stat /csspc/etc/go/src/cmd/api/run.go: no such file or directory
> 2016/12/02 10:38:43 Failed: exit status 1
> 2016/12/02 10:38:43 FAILED
> root@csspc-base:/csspc/etc/go/src#
>
> is this a known issue? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Extending objects / methods

2016-12-02 Thread Slawomir Pryczek
Thanks for the post, yes basically i don't want to inherit old methods... 
the member approach would work for me but im thinking if that won't be 
slow, probably will do some tests... basically im trying to find some way 
of doing this without need of additional struct with just one member...

type xadvanced *x
defining type xadvanced (with 0 methods), adding some methods to xadvanced, 
which will access methods of "parent" type x ... by doing something like 
"pointer conversion" in C, but I didn't found a way of doing this ... so 
that's maybe not possible



W dniu piątek, 2 grudnia 2016 16:39:31 UTC+1 użytkownik parais...@gmail.com 
napisał:
>
> The declared type does not inherit any methods 
>>  bound to the existing 
>> type, but the method set  of an 
>> interface type or of elements of a composite type remains unchanged:
>
>
> https://golang.org/ref/spec#Type_declarations
>
> You need to use another strategy like struct embedding which *may *or *may 
> not* work depending to your use case
>
> A field declared with a type but no explicit field name is an *anonymous 
>> field*, also called an *embedded* field or an embedding of the type in 
>> the struct. An embedded type must be specified as a type name T or as a 
>> pointer to a non-interface type name *T, and T itself may not be a 
>> pointer type. The unqualified type name acts as the field name.
>
>
> type xadvanced struct {
> *x
> }
> func(x *xadvanced)increment(){
>x.y ++
>fmt.Println(x.y)
> }
>
> I'd advise you do read the spec at least once, it's short and concise .
>
>
> Le vendredi 2 décembre 2016 16:25:50 UTC+1, Slawomir Pryczek a écrit :
>>
>> Hi Guys,
>>
>> i want to make something like this
>>
>> type si struct {
>>
>> s *sync_task.Sync_task
>>
>> }
>>
>>
>> func (this *si) Process() {
>>
>>
>>... some code here ...
>>
>>this.Process();
>>
>> }
>>
>>
>>
>> Basically i want to extend object in another package... and this works. 
>> Now i'd just want to extend it without creating "real" struct, code
>>
>> type x struct {
>> y int
>> }
>> type xadvanced *x
>>
>> func (this *x) increment() {
>> this.y++
>> fmt.Println(this.y)
>> }
>>
>> test2 := xadvanced()
>> test2.increment() ---> ERROR
>>
>> https://play.golang.org/
>>
>> What im doing wrong and how to access methods of x object when having 
>> pointer to xadvanced...
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] go1.7.4 API check Fail

2016-12-02 Thread gocss
during ./all.bash
# ../test

# API check
stat /csspc/etc/go/src/cmd/api/run.go: no such file or directory
2016/12/02 10:38:43 Failed: exit status 1
2016/12/02 10:38:43 FAILED
root@csspc-base:/csspc/etc/go/src#

is this a known issue? 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] What about QNX golang support ?

2016-12-02 Thread Konstantin Khomoutov
On Fri, 2 Dec 2016 06:21:51 -0800 (PST)
Yuriy Yarosh  wrote:

> So, I'm currently interested in using golang for a QNX based project,
> but afaik there was no QNX port yet.
> Is it even possible now ?

There exists a document describing a policy of porting Go to a new
platform [1].  If you're OK with the requirement, you can bring this
question on the golang-dev mailing list.

1. https://github.com/golang/go/wiki/PortingPolicy

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Extending objects / methods

2016-12-02 Thread paraiso . marc

>
> The declared type does not inherit any methods 
>  bound to the existing 
> type, but the method set  of an 
> interface type or of elements of a composite type remains unchanged:


https://golang.org/ref/spec#Type_declarations

You need to use another strategy like struct embedding which *may *or *may 
not* work depending to your use case

A field declared with a type but no explicit field name is an *anonymous 
> field*, also called an *embedded* field or an embedding of the type in 
> the struct. An embedded type must be specified as a type name T or as a 
> pointer to a non-interface type name *T, and T itself may not be a 
> pointer type. The unqualified type name acts as the field name.


type xadvanced struct {
*x
}
func(x *xadvanced)increment(){
   x.y ++
   fmt.Println(x.y)
}

I'd advise you do read the spec at least once, it's short and concise .


Le vendredi 2 décembre 2016 16:25:50 UTC+1, Slawomir Pryczek a écrit :
>
> Hi Guys,
>
> i want to make something like this
>
> type si struct {
>
> s *sync_task.Sync_task
>
> }
>
>
> func (this *si) Process() {
>
>
>... some code here ...
>
>this.Process();
>
> }
>
>
>
> Basically i want to extend object in another package... and this works. 
> Now i'd just want to extend it without creating "real" struct, code
>
> type x struct {
> y int
> }
> type xadvanced *x
>
> func (this *x) increment() {
> this.y++
> fmt.Println(this.y)
> }
>
> test2 := xadvanced()
> test2.increment() ---> ERROR
>
> https://play.golang.org/
>
> What im doing wrong and how to access methods of x object when having 
> pointer to xadvanced...
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Run some extra setup on each test

2016-12-02 Thread paraiso . marc
You can use sub-tests 

https://blog.golang.org/subtests

if you need to pass some data to a subtest you can use closures like 

func(data Data) func ( t *testing.T) {
  return func( t *testing.T) {
  print(data)
   }
}

If you need a more traditional setup/teardown fixture based test runner, 
then you need to use something else like Go convey. Granted it means slower 
tests.

Le vendredi 2 décembre 2016 14:48:53 UTC+1, Jérôme LAFORGE a écrit :
>
> Hello all,
> Do you know an elegant workaround that allows to execute extra setup on 
> each test (kind of TestMain but for each test) ?
> If not, did you plan to add this kind of feature into next release of Go ?
>
> Thank in advance.
> BR
> Jérôme
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Extending objects / methods

2016-12-02 Thread Slawomir Pryczek
Hi Guys,

i want to make something like this

type si struct {

s *sync_task.Sync_task

}


func (this *si) Process() {


   ... some code here ...

   this.Process();

}



Basically i want to extend object in another package... and this works. Now 
i'd just want to extend it without creating "real" struct, code

type x struct {
y int
}
type xadvanced *x

func (this *x) increment() {
this.y++
fmt.Println(this.y)
}

test2 := xadvanced()
test2.increment() ---> ERROR

https://play.golang.org/

What im doing wrong and how to access methods of x object when having 
pointer to xadvanced...

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] What about QNX golang support ?

2016-12-02 Thread Yuriy Yarosh
So, I'm currently interested in using golang for a QNX based project, but 
afaik there was no QNX port yet.
Is it even possible now ?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: GDB support for goroutines in core files

2016-12-02 Thread huangbaocheng66
Hello Aaron, have you figure it out yet?  

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Run some extra setup on each test

2016-12-02 Thread Jérôme LAFORGE
Hello all,
Do you know an elegant workaround that allows to execute extra setup on 
each test (kind of TestMain but for each test) ?
If not, did you plan to add this kind of feature into next release of Go ?

Thank in advance.
BR
Jérôme

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Inlining local functions

2016-12-02 Thread Michael Jones
go build –gcflags=-m

 

will show you what is and is not inlined. This is not the structural answer you 
seek, but it is the factual result of it. 

 

From:  on behalf of 
Date: Friday, December 2, 2016 at 2:58 AM
To: golang-nuts 
Cc: 
Subject: [go-nuts] Re: Inlining local functions

 

On Friday, 2 December 2016 11:55:59 UTC+1, nsa...@gmail.com wrote:

Is there a summary somewhere of the general rules determining when

do functions get inlined?

 

Specifically, it should always be a good decision to inline a

function that is only called from one place in the code (that is, a

non-reused function). Do such (at least non-exported ones)

functions get inlined by the compiler?

Clarification: I'm asking about implementation specific details.

 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Inlining local functions

2016-12-02 Thread nsajko
On Friday, 2 December 2016 11:55:59 UTC+1, nsa...@gmail.com wrote:
>
> Is there a summary somewhere of the general rules determining when
> do functions get inlined?
>
> Specifically, it should always be a good decision to inline a
> function that is only called from one place in the code (that is, a
> non-reused function). Do such (at least non-exported ones)
> functions get inlined by the compiler?
>
Clarification: I'm asking about implementation specific details.
 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Inlining local functions

2016-12-02 Thread nsajko
Is there a summary somewhere of the general rules determining when
do functions get inlined?

Specifically, it should always be a good decision to inline a
function that is only called from one place in the code (that is, a
non-reused function). Do such (at least non-exported ones)
functions get inlined by the compiler?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go 1.8 Beta 1 is released

2016-12-02 Thread Zlatko Čalušić

On 02.12.2016 11:09, minux wrote:


On Fri, Dec 2, 2016 at 4:58 AM, Zlatko Čalušić > wrote:


Hello,

and thanks for another great Go release!

I have just one question, and it's not specific to this beta, but
all Go betas and rc-s.

I compile Go from repository like this:

cd $HOME/src/go.googlesource.com/go 
git checkout -f master
git clean -fdx
git pull --ff-only
git checkout -f go1.8beta1
cd src && make.bash

The resulting binary unfortunately is not labeled as go1.8beta1,
but instead:

go version *devel +41908a5* Thu Dec 1 02:54:21 2016 + linux/amd64

What follows next is that various Go software, where developers
decided to explicitely test for Go version (and of course don't
deal well with devel versions) fails to compile. One example is
gopherjs, it's uncompilable with this beta version, unless I
manually edit the source and remove gratuitous checks.

The question is, how do I persuade the compiled beta to report
version as go1.8beta1?


Because betas are just tags from the master branch, there is no way to 
change the
VERSION file to read go1.8beta1. If you're going to report an issue, 
just include the
full "go version" and it should be fine. If you insist on having go 
version report go1.8beta1,
you can create a VERSION file at $GOROOT that read "go1.8beta1" and 
rebuild Go.
However this is not recommended as git repository is a moving target 
and if you
checkout a new revision without removing the VERSION file, the 
reported version

would still be go1.8beta1, which will be really confusing.

However, if you download the go1.8beta1 source tarball, then the 
VERSION file will

correctly indicate go1.8beta1.


Ah, I see... Thank you for the hint minux!

I can live with a bit of manual editing, it's not that beta's are 
released every day. :)


Also git clean -fdx step from my simple compilation script takes care of 
removing stale VERSION files, so all should be OK.


go version *go1.8beta1* linux/amd64

Yay! :)

Now, to see if gopherjs fancies THIS version string...

--
Zlatko

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go 1.8 Beta 1 is released

2016-12-02 Thread minux
On Fri, Dec 2, 2016 at 4:58 AM, Zlatko Čalušić  wrote:

> Hello,
>
> and thanks for another great Go release!
> I have just one question, and it's not specific to this beta, but all Go
> betas and rc-s.
>
> I compile Go from repository like this:
>
> cd $HOME/src/go.googlesource.com/go
> git checkout -f master
> git clean -fdx
> git pull --ff-only
> git checkout -f go1.8beta1
> cd src && make.bash
>
> The resulting binary unfortunately is not labeled as go1.8beta1, but
> instead:
>
> go version *devel +41908a5* Thu Dec 1 02:54:21 2016 + linux/amd64
>
> What follows next is that various Go software, where developers decided to
> explicitely test for Go version (and of course don't deal well with devel
> versions) fails to compile. One example is gopherjs, it's uncompilable with
> this beta version, unless I manually edit the source and remove gratuitous
> checks.
>
> The question is, how do I persuade the compiled beta to report version as
> go1.8beta1?
>

Because betas are just tags from the master branch, there is no way to
change the
VERSION file to read go1.8beta1. If you're going to report an issue, just
include the
full "go version" and it should be fine. If you insist on having go version
report go1.8beta1,
you can create a VERSION file at $GOROOT that read "go1.8beta1" and rebuild
Go.
However this is not recommended as git repository is a moving target and if
you
checkout a new revision without removing the VERSION file, the reported
version
would still be go1.8beta1, which will be really confusing.

However, if you download the go1.8beta1 source tarball, then the VERSION
file will
correctly indicate go1.8beta1.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go 1.8 Beta 1 is released

2016-12-02 Thread Zlatko Čalušić

Hello,

and thanks for another great Go release!

I have just one question, and it's not specific to this beta, but all Go 
betas and rc-s.


I compile Go from repository like this:

cd $HOME/src/go.googlesource.com/go
git checkout -f master
git clean -fdx
git pull --ff-only
git checkout -f go1.8beta1
cd src && make.bash

The resulting binary unfortunately is not labeled as go1.8beta1, but 
instead:


go version *devel +41908a5* Thu Dec 1 02:54:21 2016 + linux/amd64

What follows next is that various Go software, where developers decided 
to explicitely test for Go version (and of course don't deal well with 
devel versions) fails to compile. One example is gopherjs, it's 
uncompilable with this beta version, unless I manually edit the source 
and remove gratuitous checks.


The question is, how do I persuade the compiled beta to report version 
as go1.8beta1?


I have a feeling there should be a simple recipe for that, which would 
better the chance of successful compile for various picky projects. :)


Thanks for any hint you can provide.

Regards,

On 01.12.2016 04:40, Chris Broadfoot wrote:

Hello gophers,

We have just released go1.8beta1, a beta version of Go 1.8.
It is cut from the master branch at the revision tagged go1.8beta1.

There are no known problems or regressions.
Please try running production workloads and your unit tests with the 
new version.


It is important that we find bugs *before* issuing a release candidate.
The release candidate is planned for the first week of January.
Your help in testing this beta is invaluable.

Report any problems using the issue tracker:
https://golang.org/issue/new

You can download binary and source distributions from the usual place:
https://golang.org/dl/#go1.8beta1

To find out what has changed in Go 1.8, read the draft release notes:
https://beta.golang.org/doc/go1.8

Documentation for Go 1.8 is available at:
https://beta.golang.org/

Our goal is to release the final version of Go 1.8 on February 1st.

Cheers,
Chris
--
You received this message because you are subscribed to the Google 
Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to golang-nuts+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Zlatko

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] go tool compile show error “main.go:3: can't find import: "fmt"”

2016-12-02 Thread jianfeng ye
my code like this:

package main

package main

import "fmt"

func f(q int) {
fmt.Println(q)
}

func g(p int) int {
var sum int
for i := 0; i < p; i++ {
sum = sum + i
}
f(sum)
return sum
}

func main() {
c := g(4) + 1
_ = c
}



and i use command:

GOOS=linux GOARCH=amd64 go tool compile -S main.go > main.S

show the error:

main.go:3: can't find import: "fmt"


but i am sure my GOROOT is right。

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.