Re: [go-nuts] why does runtime.GOMAXPROCS act like getter and setter?

2016-12-23 Thread Tyler Compton
The documentation suggests it's a temporary API, too: "This call will go away when the scheduler improves." I don't think it should be removed, though, even if it isn't included in the compatibilty guarantee. I'd be surprised to hear if people have trouble with its semantics. It's pretty simple,

[go-nuts] Raspberry Pi : PIXEL for PC and Mac: Go

2016-12-23 Thread Dave Cheney
Nice. Thanks for confirming. -- 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.goo

[go-nuts] howto programatically resolve an import path ?

2016-12-23 Thread mhhcbon
Hi, i m looking for the right way to load and parse an ast.ImportSpec referenced into an ast.File object. Its mostly about the path resolution, I can t find a method like parse(baseDir string, pkgPath string)... where baseDir (is not necessarily the same as the ast.File path, in my understand

Re: [go-nuts] Re: Json-ifying map[bson.ObjectId] is not as expected

2016-12-23 Thread Matt Harden
Because the underlying type of bson.ObjectID is string, the map marshaller uses the underlying string (coerced to valid utf-8) as the JSON map key directly. In the case of ObjectID that's a bad thing because many ObjectIDs contain bytes that are not valid utf-8 and get replaced with the unicode rep

[go-nuts] Raspberry Pi : PIXEL for PC and Mac: Go

2016-12-23 Thread peterGo
PIXEL for PC and Mac https://www.raspberrypi.org/blog/pixel-pc-mac/ PIXEL for PC and Mac, a new Linux distribution from Raspberry Pi, doesn't come with Go installed. As a test, I installed Go on a PC from source and ran all tests successfully. pi@raspberrypi:~/go/src $ ./all.bash <> ALL TESTS

[go-nuts] Gomobile: Getting errors when trying to build reverse example

2016-12-23 Thread glenford williams
sh ./gradlew gomobileDebug :gobindDebug flag provided but not defined: -classpath Usage of /home/kingwill101/go/bin/gobind: -javapkg string custom Java package path used instead of the default 'go.'. Valid only with -lang=java. -lang string target language for bindings, either j

Re: [go-nuts] why does runtime.GOMAXPROCS act like getter and setter?

2016-12-23 Thread Michael Jones
If it was to be changed, it might be good to add the pair: Gomaxprocs() SetGomaxprocs() I remember at the time it was suggested that it was "temporary API" that would go away someday. I have learned that there is rarely a temporary API, temporary utility, etc. On Fri, Dec 23, 2016 at 8:26 AM,

Re: [go-nuts] why does runtime.GOMAXPROCS act like getter and setter?

2016-12-23 Thread Ian Lance Taylor
On Fri, Dec 23, 2016 at 12:44 AM, P Q wrote: > runtime.GOMAXPROCS(n) behaves in two ways: getter if n < 1, otherwise > setter. > > For setter, does runtime.SetGOMAXPROCS(n) look good? The only reason behind > current behavior is the function is rarely used? Does anybody actually make a mistake he

[go-nuts] Re: Unable to use net/http/pprof to profile live webserver

2016-12-23 Thread mark
Besides the HTTP standard approach and the workaround that Shawn mentioned, a couple other options include: * installing the gops agent [1] in the binary and using the gops CLI when SSHed onto the machine * adding your own hook (via CLI, custom HTTP endpoint, on a timer, etc.) to directly captu

[go-nuts] Re: install go compiler without sudo right

2016-12-23 Thread peterGo
Bill, The OP said: "I tried to install go1.4 then use it to install latest go." Then you asked the OP: "Do you want to use Go version 1.4 specifically for some reason?" Peter On Thursday, December 22, 2016 at 12:57:40 PM UTC-5, bill.h...@gmail.com wrote: > > Do you want to use Go version 1.4

[go-nuts] why does runtime.GOMAXPROCS act like getter and setter?

2016-12-23 Thread P Q
runtime.GOMAXPROCS(n) behaves in two ways: getter if n < 1, otherwise setter. For setter, does runtime.SetGOMAXPROCS(n) look good? The only reason behind current behavior is the function is rarely used? -- You received this message because you are subscribed to the Google Groups "golang-nuts

[go-nuts] Re: Simple Go program that doesn't seem to free memory as it should...

2016-12-23 Thread 'Keith Randall' via golang-nuts
I think what is going on is this. y := []*int{&x[0]} compiles to: var z [1]*int // allocate backing array p = &z // take its address p[0] = &x[0] // initialize it y := z[:]// slice it Because z has its address taken, we conservatively assume that z lives