Re: [go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Ian Lance Taylor
On Wed, Aug 31, 2016 at 7:54 PM, Lin Hao wrote: > > I mean, sched.midle is a single linked list, but its mode of operation is > different from sched.runqhead/runqtail, why? (or, Why they used different > structure?) The midle list is a list of M's that aren't doing anything. It doesn't matter wh

Re: [go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Lin Hao
Sorry, I haven't expressed clearly. I didn't suggest anything, just wondering, so I want to ask about it. I mean, sched.midle is a single linked list, but its mode of operation is different from sched.runqhead/runqtail, why? (or, Why they used different structure?) -- You received this message b

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-31 Thread Jonathan Pittman
Does the license need to be the same as the standard Go License if it starts in another repo and then moves over? On Wed, Aug 31, 2016 at 8:19 PM, Nigel Tao wrote: > On Mon, Aug 29, 2016 at 12:27 PM, Jonathan Pittman > wrote: > > To everyone, I really want to see this live in the golang.org/x/i

[go-nuts] Go 1.7 vs Go 1.5 performance

2016-08-31 Thread lennykneller
Unfortunately, I don't have Go 1.6 numbers. I benchmarked my parallel 2-d convex hull program in Go 1.5 and Go 1.7 on Windows 64-bit platform. The code uses big rational numbers (math/big.Rat) which puts pressure on the GC. I observed noticeable reduction in run times: 1-core version of the Go 1

[go-nuts] Re: Unable to Get SID in golang

2016-08-31 Thread brainman
On Thursday, 1 September 2016 00:10:39 UTC+10, kumargv wrote: > I am getting SID of my system using WMI > > >wmic useraccount where name='vijay' get sid > SID > S-1-5-21-742204146-2006990925-2362806598-1001 > > But still i am not able to get sid structure . golang.org/x/sys/windows.SID is define

Re: [go-nuts] unsupported GOOS/GOARCH pair darwin/x86_64 on mac installed from package

2016-08-31 Thread Dan Kortschak
On Wed, 2016-08-31 at 17:37 -0700, Ian Lance Taylor wrote: > Set GOARCH in the environment to amd64, not x86_64. Or don't bother > to set it at all. > Thanks Ian. Just went through and clean out many GO* vars from his .profile. -- You received this message because you are subscribed to the Goog

Re: [go-nuts] unsupported GOOS/GOARCH pair darwin/x86_64 on mac installed from package

2016-08-31 Thread Ian Lance Taylor
On Wed, Aug 31, 2016 at 5:19 PM, Dan Kortschak wrote: > One of my users has struck a problem with an install of go1.7 from the > packages at [1] that has me baffled. I don't use a mac, so I've depleted > my knowledge of what might be going on here. Can anyone help? > $ go run hello.go > cmd/go: u

[go-nuts] Re: unsupported GOOS/GOARCH pair darwin/x86_64 on mac installed from package

2016-08-31 Thread Dave Cheney
It looks like they've exported GOARCH=x86_64 which is the linux preferred word for amd64. They should either remove the GOARCH setting or set it to GOARCH=amd64 On Thursday, 1 September 2016 10:19:35 UTC+10, kortschak wrote: > > One of my users has struck a problem with an install of go1.7 from

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-31 Thread Nigel Tao
On Mon, Aug 29, 2016 at 12:27 PM, Jonathan Pittman wrote: > To everyone, I really want to see this live in the golang.org/x/image repo. > Do we need to create a formal proposal for it to live there? Should we do > the initial development in another repo and then move it to the x/image repo > late

[go-nuts] unsupported GOOS/GOARCH pair darwin/x86_64 on mac installed from package

2016-08-31 Thread Dan Kortschak
One of my users has struck a problem with an install of go1.7 from the packages at [1] that has me baffled. I don't use a mac, so I've depleted my knowledge of what might be going on here. Can anyone help? thanks Dan The OS is 10.11.6 on a macbook. $ go run hello.go cmd/go: unsupported GOOS/GOA

Re: [go-nuts] gomobile init should have a flag if we want only IOS or Android

2016-08-31 Thread Hyang-Ah Hana Kim
What do you think if the error message is modified to clearly include the instruction for xcode installation? On Mon, Aug 29, 2016 at 6:03 AM, Abhishek Sinha wrote: > While doing gomobile init on OSX, I get the following error > gomobile: xcrun --show-sdk-path: exit status 1 > xcrun: error: SDK

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread Tim Hawkins
I would have expected that aside from informing about general performance, one of the purposes for benchmarks would have been to create pressure for improvement of key features of the laguage, this seems to circumvent this, im not dure what they are trying to achive. Perhaps restrictions on only us

Re: [go-nuts] Conditional compiling for android

2016-08-31 Thread Nigel Tao
On Wed, Aug 31, 2016 at 4:45 AM, Sapna Todwal wrote: > I already tried this and it doesn't work . That's odd. It should work. What are your filenames? What do your "// +build" lines look like exactly? > Also I need a way to enable > certain code only for pure android and not linux. Any suggesti

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread Harald Weidner
Hello, On Wed, Aug 31, 2016 at 08:44:41AM -0700, 'Eric Johnson' via golang-nuts wrote: > >The Java counterpart of this benchmark does not use the Java build-in > >maps, but imports a map implementation for fixed data types from the > >fastutil project. > I hadn't noticed that. That would seem to

Re: [go-nuts] Cgo Pointer Arithmetic

2016-08-31 Thread Ian Lance Taylor
On Wed, Aug 31, 2016 at 2:06 PM, Luke Mauldin wrote: > I modified my example based on the code example you gave at the bottom for > the pointer arithmetic and that compiled without any go vet errors. I > attempted to use the slice whose backing array is the C array > https://play.golang.org/p/rJo

[go-nuts] Re: Close a reader to quit a loop without closing its source

2016-08-31 Thread adonovan via golang-nuts
On Wednesday, 31 August 2016 07:48:12 UTC-4, Dave Cheney wrote: > > Unfortunately POSIX does not guarantee that close from one thread will > unblock another. To read from a file without waiting longer than a specified time, you need to use the POSIX 'select' system call, which you can find at

[go-nuts] Using go mobile with Cordova

2016-08-31 Thread Joe Blue
Building html5 Cordova apps is pretty easy. But I want to put a golang web server being it that is exposing a restful json API. The HTML5 GUI can then call it. I am using the recent json patch functionality to allow the GUI layer to constantly update the db ( boltdb) with changes. What are my o

Re: [go-nuts] Cgo Pointer Arithmetic

2016-08-31 Thread Luke Mauldin
I modified my example based on the code example you gave at the bottom for the pointer arithmetic and that compiled without any go vet errors. I attempted to use the slice whose backing array is the C array https://play.golang.org/p/rJoDMu5YAQ but I get a compile error: main.go:14: cannot conve

Re: [go-nuts] Cgo Pointer Arithmetic

2016-08-31 Thread Ian Lance Taylor
On Wed, Aug 31, 2016 at 12:47 PM, Luke Mauldin wrote: > > I have questions about pointer arithmetic illustrated by this Play example: > https://play.golang.org/p/-cZteTY_M2 > > Questions: > 1) Is this the best way to do pointer arithmetic in Go to process a C array > and convert it to a Go slice?

[go-nuts] Cgo Pointer Arithmetic

2016-08-31 Thread Luke Mauldin
I have questions about pointer arithmetic illustrated by this Play example: https://play.golang.org/p/-cZteTY_M2 Questions: 1) Is this the best way to do pointer arithmetic in Go to process a C array and convert it to a Go slice? 2) Go vet gives an error on line 18 but doesn't give much informa

Re: [go-nuts] Compiler plugins or something?

2016-08-31 Thread 'Samuel Tan' via golang-nuts
Got it. Thanks for the quick follow-up, Ian. On Wed, Aug 31, 2016 at 11:00 AM, Ian Lance Taylor wrote: > On Wed, Aug 31, 2016 at 10:31 AM, samueltan via golang-nuts > wrote: > > May I know what the status of compiler plugins are as of Go 1.7? I'm > hoping > > to add an additional stage of stati

Re: [go-nuts] Compiler plugins or something?

2016-08-31 Thread Ian Lance Taylor
On Wed, Aug 31, 2016 at 10:31 AM, samueltan via golang-nuts wrote: > May I know what the status of compiler plugins are as of Go 1.7? I'm hoping > to add an additional stage of static checking to the Go compilation process, > and the only way to do this right now seems to be to write a go vet chec

Re: [go-nuts] Compiler plugins or something?

2016-08-31 Thread samueltan via golang-nuts
May I know what the status of compiler plugins are as of Go 1.7? I'm hoping to add an additional stage of static checking to the Go compilation process, and the only way to do this right now seems to be to write a go vet check. On Wednesday, October 7, 2015 at 9:59:26 AM UTC-7, Ian Lance Taylor

[go-nuts] Re: What is the difference between fmt.Print and rand.Intn functions here?

2016-08-31 Thread T L
@peterGo @Chris thanks! I forgot the parameters of fmt.Print are of type interface{}. On Wednesday, August 31, 2016 at 11:23:51 PM UTC+8, peterGo wrote: > > TL, > > Radically different parameters: > > func Intn(n int ) int >

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread 'Eric Johnson' via golang-nuts
On 8/31/16 2:04 AM, Harald Weidner wrote: Hello, On Tue, Aug 30, 2016 at 04:41:29PM -0700, 'Eric Johnson' via golang-nuts wrote: I looked at the k-nucleotide program, and was unable to figure out a way to make it faster. This is, of course, exactly what the test is suppose to be checking - th

[go-nuts] Re: What is the difference between fmt.Print and rand.Intn functions here?

2016-08-31 Thread peterGo
TL, Radically different parameters: func Intn(n int ) int func Println(a ...interface{}) (n int , err error ) Peter On Wednesday, August 31,

Re: [go-nuts] What is the difference between fmt.Print and rand.Intn functions here?

2016-08-31 Thread 'Chris Manghane' via golang-nuts
You can use something like `go build -gcflags="-m -m" ...` to get more information about why something escape. David Chase has added excellent descriptions of why something escapes. There's a lot of detail about fmt.Print functions escape, in general, but without going into detail, we can look at

[go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread Torsten Bronger
Hallöchen! Peter Herth writes: > I am not sure I agree. Writing them in idiomatic might be good to > detect whether idiomatic works for getting fast code, but on the > other side, if I am writing a large application, I might use > slower, idiomatic code in 90% of it, and then optimize the hell >

[go-nuts] What is the difference between fmt.Print and rand.Intn functions here?

2016-08-31 Thread T L
Why does the parameter passed to fmt.Print escape to heap? // 11.go package main import "fmt" import "math/rand" func f1(v int) { fmt.Print(v) // v escapes to heap } var a int func f2(v int) { a = rand.Intn(v) // v doesn't escape } func main() { } /* > go build -gcflags=-m 11.go # co

[go-nuts] Unable to Get SID in golang

2016-08-31 Thread kumargv
I am getting SID of my system using WMI >wmic useraccount where name='vijay' get sid SID S-1-5-21-742204146-2006990925-2362806598-1001 But still i am not able to get sid structure . package main import ( "fmt" "golang.org/x/sys/windows" ) func main() { sid , domain, accType , err := windo

Re: [go-nuts] Re: dynamic frequency ticker

2016-08-31 Thread Marvin Renich
> > On Tuesday, August 30, 2016 at 8:46:23 PM UTC+3, seb@gmail.com wrote: > >> > >> In my application I select on a ticker channel, but sometimes need to > >> have the waiting time vary a bit. For not so frequent changes I could make > >> a new ticker everytime, but I have the feeling this is

[go-nuts] Encrypt x/crypto/openpgp private key

2016-08-31 Thread Adrià Casajús
Hello, I'm trying to use x/crypto/openpgp but I can't find how to encrypt a packet.PrivateKey. It's clear how to decrypt it but how do encrypt it with a passphrase? Thanks in advance, Adri -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread Peter Herth
I am not sure I agree. Writing them in idiomatic might be good to detect whether idiomatic works for getting fast code, but on the other side, if I am writing a large application, I might use slower, idiomatic code in 90% of it, and then optimize the hell out of the bottlenecks, throwing any elegan

Re: [go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Ian Lance Taylor
On Tue, Aug 30, 2016 at 10:19 PM, Lin Hao wrote: > > I'm reading the runtime code, and there are some questions, as shown below: > > func globrunqput(gp *g) { > gp.schedlink = 0 > if sched.runqtail != 0 { > sched.runqtail.ptr().schedlink.set(gp)// My question: why? > > // I feel should be

[go-nuts] Re: dynamic frequency ticker

2016-08-31 Thread yann . briffa
Hi there, maybe you should take a look on this one : https://play.golang.org/p/SpTNuGG-ni On Wednesday, August 31, 2016 at 8:25:21 AM UTC+2, dja...@gmail.com wrote: > > https://play.golang.org/p/FMs01ACKJv ? > > Djadala > > On Tuesday, August 30, 2016 at 8:46:23 PM UTC+3, seb@gmail.com wrote

[go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread Nicola Larosa (tekNico)
Speaking of adoption, here's another awesome graph from OpenHub: :-)

[go-nuts] Re: bytes.Buffer and bufio.Reader are no seekers?

2016-08-31 Thread Guillaume LE STUM
I just ran into this as well, when buffering an io.ReadSeeker such as os.File it would be useful to have a bufio.ReadSeeker. I could work around it by calling Seek on the source os.File and using bufio.Reader.Reset(...) but this is wasteful when seeked data is already buffered On Thursday, May

[go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Lin Hao
Hi, all: I'm reading the runtime code, and there are some questions, as shown below: func globrunqput(gp *g) { gp.schedlink = 0 if sched.runqtail != 0 { sched.runqtail.ptr().schedlink.set(gp)// My question: why? /

[go-nuts] Close a reader to quit a loop without closing its source

2016-08-31 Thread Dave Cheney
Unfortunately POSIX does not guarantee that close from one thread will unblock another. -- 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...@

[go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread Torsten Bronger
Hallöchen! Harald Weidner writes: > On Tue, Aug 30, 2016 at 04:41:29PM -0700, 'Eric Johnson' via golang-nuts > wrote: > >> I looked at the k-nucleotide program, and was unable to figure >> out a way to make it faster. > >> This is, of course, exactly what the test is suppose to be >> checking -

[go-nuts] Close a reader to quit a loop without closing its source

2016-08-31 Thread mhhcbon
Hi, I have a small program to read stdin and execute some commands accordingly. It s composed of a for loop which waits for data to read on the source. I found out i could quit the loop by closing its source and catching err on ReadString calls to skip the iteration. Qs are, - is there a clean

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-31 Thread Harald Weidner
Hello, On Tue, Aug 30, 2016 at 04:41:29PM -0700, 'Eric Johnson' via golang-nuts wrote: > I looked at the k-nucleotide program, and was unable to figure out a way to > make it faster. > This is, of course, exactly what the test is suppose to be checking - the > speed of the built in map. Anyone e