[go-nuts] Re: json package error ?

2016-10-05 Thread Marcin Jurczuk
Hi, This definitely help. Problem solved. W dniu poniedziałek, 3 października 2016 19:40:06 UTC+2 użytkownik 刘湃 napisał: > > Try this https://play.golang.org/p/54Utd1Vsw3 > > https://godoc.org/encoding/json#Marshal > > String values encode as JSON strings coerced to valid UTF-8, replacing > inv

[go-nuts] exec.Command

2016-10-05 Thread hadiesmaili85
hi in the second arg in function exec.Command(), what i must put it?? and any my question is : i want run a cmd command.for example : cls how can i run this method? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

Re: [go-nuts] exec.Command

2016-10-05 Thread Marvin Renich
* hadiesmail...@gmail.com [161005 05:46]: > hi > > in the second arg in function exec.Command(), what i must put it?? > > and any my question is : > > i want run a cmd command.for example : cls > > how can i run this method? The second argument is a variadic argument, so you can omit it; see

[go-nuts] Re: exec.Command

2016-10-05 Thread hadiesmaili85
but i test this code it does not work! Why?? On Wednesday, October 5, 2016 at 2:46:37 AM UTC-7, hadies...@gmail.com wrote: > > hi > > in the second arg in function exec.Command(), what i must put it?? > > and any my question is : > > i want run a cmd command.for example : cls > > how can i run t

Re: [go-nuts] go closure escape analysis

2016-10-05 Thread 刘桂祥
In go when closure call the out varible will pass pointer to the closure func so I doubt in example2.go y is passed &y to closure I don't know the compile how to analysis this and decide that can be allocated in stack correctly ? 在 2016年10月4日星期二 UTC+8下午11:54:02,Chris Manghane写道: > > In e

[go-nuts] when the runtime decide to threadcreate

2016-10-05 Thread 刘桂祥
package main import ( "bufio" "net/http" _ "net/http/pprof" "os" "time" ) func main() { go func() { http.ListenAndServe(":8080", nil) }() reader := bufio.NewReader(os.Stdin) for i := 0; i < 100; i++ { go func(id int) { for {

Re: [go-nuts] Single instance of program

2016-10-05 Thread dc0d
Nice! Seems working! I could not get Unix Domain Socket to work, since I expected an error on Listen or Accept but there were no errors. On Wednesday, October 5, 2016 at 12:00:12 AM UTC+3:30, Ingo Oeser wrote: > > Are you looking for something like > https://godoc.org/github.com/nightlyone/lock

Re: [go-nuts] when the runtime decide to threadcreate

2016-10-05 Thread Ian Lance Taylor
On Wed, Oct 5, 2016 at 7:09 AM, 刘桂祥 wrote: > > want to ask when the runtime decide to threadcreate : long time not return > syscall ? any others ?? The runtime creates a new thread whenever there is a goroutine ready to run and the number of currently running goroutines is less than GOMAXPROCS.

[go-nuts] Re: Cookies lose data when round tripped through net/http/cookiejar.Jar

2016-10-05 Thread Nate Finch
Got some insight about this from Rog Peppe. The problem seems to step from the fact that the String() method on http.Cookie does different things based on what values are set in the cookie. If it's just Name and Value, then String() returns a value suitable for a Cookie header (i.e. what you'd

Re: [go-nuts] go closure escape analysis

2016-10-05 Thread 'Chris Manghane' via golang-nuts
Sorry, poor explanation again. When a variable is used from outside a closure's scope, it is *captured* by the closure. Usually that means that the closure function is modified to include a reference to that variable when it is called as a regular function. An example from the compiler: https://gi

[go-nuts] Re: [ANN] gorram: like go run for any* function in stdlib or GOPATH

2016-10-05 Thread sethamclean
That is... awesome... On Monday, October 3, 2016 at 5:00:34 PM UTC-4, Nate Finch wrote: > > get it via the canonical import path: > > go get npf.io/gorram > > > Code is at https://github.com/natefinch/gorram > > > Still a work in progress, but fun to play around with right now. > > Lets you do thi

Re: [go-nuts] Re: exec.Command

2016-10-05 Thread Brad Fitzpatrick
You didn't say how it doesn't work. You need to ask good questions to get good answers. On Wed, Oct 5, 2016 at 6:16 AM, wrote: > but i test this code it does not work! > > Why?? > > > On Wednesday, October 5, 2016 at 2:46:37 AM UTC-7, hadies...@gmail.com > wrote: >> >> hi >> >> in the second ar

[go-nuts] Re: [ANN] gorram: like go run for any* function in stdlib or GOPATH

2016-10-05 Thread Nate Finch
Glad you think so :) Suggestions and bugs welcome. It's under active development, and I know some things don't work right now (like variadic functions), but I'd like to make it work with as wide a swath of go functions as I can :) And I think that, since there's such a strong culture of bein

[go-nuts] [ANN] RapidMQ is released

2016-10-05 Thread vadim . shakun
RapidMQ is a pure, extremely productive, lightweight and relaible library for managing of the local messages queue Full information about library you can find here: https://github.com/sybrexsys/RapidMQ -- You received this message because you are subscribed to the Google Groups "golang-nuts" g

Re: [go-nuts] go closure escape analysis

2016-10-05 Thread 刘桂祥
1: In example2_modified.go (y=x line should be *y=x ?) and that is the same as example1.go ??? but in example1.go y is escapted and example2.go is not. 2:how do I see the compile handle closure call results ? compile para ? 在 2016年10月5日星期三 UTC+8下午11:38:42,Chris Manghane写道: > > Sorry, poor

Re: [go-nuts] go closure escape analysis

2016-10-05 Thread 'Chris Manghane' via golang-nuts
To see the escape analysis results, compile with -gcflags "-m -m -m -m". The code in each of the example should be relatively similar, which is why it is a bug that one of them causes the variable to escape to the heap. On Wed, Oct 5, 2016 at 4:46 PM, 刘桂祥 wrote: > 1: In example2_modified.go (y

Re: [go-nuts] go closure escape analysis

2016-10-05 Thread 刘桂祥
ok very thanks! 在 2016年10月6日星期四 UTC+8上午7:49:03,Chris Manghane写道: > > To see the escape analysis results, compile with -gcflags "-m -m -m -m". > The code in each of the example should be relatively similar, which is why > it is a bug that one of them causes the variable to escape to the heap. >

[go-nuts] Re: Slow compile times

2016-10-05 Thread 'simon place' via golang-nuts
none of those links work for me? On Tuesday, 4 October 2016 13:26:58 UTC+1, rene.z...@gmail.com wrote: > > Hi > > I use the following packages in a test file: > > import ( > "testing" > > "github.com/coreos/etcd/clientv3" > "github.com/coreos/etcd/integration" > "github.com/coreos/pkg/capnslog" >

Re: [go-nuts] Re: Slow compile times

2016-10-05 Thread Brad Fitzpatrick
They're not URLs. They're Go import paths. To make them into links, prefix them with https://godoc.org/ like https://godoc.org/github.com/coreos/etcd/clientv3 On Wed, Oct 5, 2016 at 5:48 PM, 'simon place' via golang-nuts < golang-nuts@googlegroups.com> wrote: > none of those links work for me? >

Re: [go-nuts] Single instance of program

2016-10-05 Thread Justin Israel
On Thu, Oct 6, 2016 at 3:15 AM dc0d wrote: > Nice! Seems working! > > I could not get Unix Domain Socket to work, since I expected an error on > Listen or Accept but there were no errors. > Works fine when I tested it using this approach: https://play.golang.org/p/A1C5BEIP2G func main() {

Re: [go-nuts] Single instance of program

2016-10-05 Thread Dave Cheney
Stick an @ at the start of the file name, or the socket will remain on disk after the process has exited. -- 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

Re: [go-nuts] Single instance of program

2016-10-05 Thread Justin Israel
On Thu, Oct 6, 2016 at 2:13 PM Dave Cheney wrote: > Stick an @ at the start of the file name, or the socket will remain on > disk after the process has exited > That's even better, and doesn't need to use the Remove(). I didn't see it documented about using @ for abstract socket. Did I miss that

[go-nuts] golang memory allocation

2016-10-05 Thread 刘桂祥
package main import ( "fmt" _ "net/http/pprof" "testing" ) // 8 Bytes/op 1 allocs/op func BenchmarkFmt1(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { fmt.Println(100) } } // 16 Bytes/op 1 allocs/op func BenchmarkFmt2(b *testing.B) { b.Re

Re: [go-nuts] Single instance of program

2016-10-05 Thread Dave Cheney
It's a Linux thing, Google abstract domain socket. -- 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, vi