Re: [go-nuts] best practices of client middleware

2018-03-07 Thread Jakob Borg
On 7 Mar 2018, at 08:07, Eyal Posener wrote: > > Very Nice stuff - shame he didn't merge it. > But I see that you changes the request in the RoundTrip function, which is > claimed as forbidden in the docs. > Again, I don't understand why the docs forbid it… I expect that this is so that the use

Re: [go-nuts] best practices of client middleware

2018-03-07 Thread eyal
In your tests in the round-trippers you do change the requests, as far as i can see. On Wed, Mar 7, 2018 at 10:13 AM Jakob Borg wrote: > On 7 Mar 2018, at 08:07, Eyal Posener wrote: > > > > Very Nice stuff - shame he didn't merge it. > > But I see that you changes the request in the RoundTrip f

Re: [go-nuts] best practices of client middleware

2018-03-07 Thread Jakob Borg
I haven’t written anything like that, I’m merely offering a suggestion on why the docs say not to do it. On 7 Mar 2018, at 09:28, eyal mailto:pose...@gmail.com>> wrote: In your tests in the round-trippers you do change the requests, as far as i can see. On Wed, Mar 7, 2018 at 10:13 AM Jakob B

[go-nuts] Is there any equivalent `fork` in Golang?

2018-03-07 Thread Jiajun Huang
hello, is there any replacement for `fork` syscall in Golang? I've found: - exec.Command - syscall.ForkExec but `exec.Command` can only execute a out side command. syscall.ForkExec is needless, because what I need is `fork` only. just like the C-way, fork, and return pid, then I entry differen

Re: [go-nuts] Is there any equivalent `fork` in Golang?

2018-03-07 Thread Lutz Horn
hello, is there any replacement for `fork` syscall in Golang? See https://stackoverflow.com/a/28371586 Note that fork() has been invented at the time when no threads were used at all, and a process had always had just a single thread of execution in it, and hence forking it was safe. With Go,

Re: [go-nuts] Is there any equivalent `fork` in Golang?

2018-03-07 Thread gansteed
thanks Lutz Horn 于2018年3月7日周三 下午7:40写道: > > hello, is there any replacement for `fork` syscall in Golang? > > See https://stackoverflow.com/a/28371586 > > > Note that fork() has been invented at the time when no threads were > > used at all, and a process had always had just a single thread of >

[go-nuts] [ANN] Get Programming with Go

2018-03-07 Thread Nathan Youngman
Learn about error handling and concurrent state in the latest release of Get Programming with Go, available from Manning Books. The first draft is complete. If you have any feedback, now’s the time to get it in, as we are currently editing the book before it goes to production. https://bit.l

[go-nuts] Re: [ANN] Get Programming with Go

2018-03-07 Thread matthewjuran
> > Go is designed for the modern data center, but its adoption isn’t > restricted to the workplace. While the garbage collector may point to this, and I’ve previously argued about data centers stepping on other applications’ feet, my understanding is the stated goal is systems programming.

[go-nuts] why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread digg
var s uint = 33 var u2 = float64(1>>s) // illegal: 1 has type float64, cannot shift -- 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...@goog

[go-nuts] Call for Papers: ManLang 2018 (Sept. 10-14, Linz, Austria)

2018-03-07 Thread manl...@jku.at
CALL FOR PAPERS 15th International Conference on Managed Languages & Runtimes (ManLang'18) September 10-14, 2018, Linz, Austria http://ssw.jku.at/manlang18/ ---

Re: [go-nuts] why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread andrey mirtchovski
the answer is hidden in the spec, i believe (it's not easy to parse, so i suggest reading the whole thing): "The right operand in a shift expression must have unsigned integer type or be an untyped constant representableby a value of type uint. If the left operand of a non-constant shift expressio

[go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread Volker Dobler
Looks suspicious. Without crosschecking the Spec: Might be a bug. File an issue? V. On Wednesday, 7 March 2018 21:39:32 UTC+1, di...@veryhaha.com wrote: > > var s uint = 33 > var u2 = float64(1>>s) // illegal: 1 has type float64, cannot shift > -- You received this message because you are su

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread Ian Lance Taylor
On Wed, Mar 7, 2018 at 12:54 PM, Volker Dobler wrote: > Looks suspicious. Without crosschecking the Spec: Might be > a bug. File an issue? It's not a bug. See Andrey's reply. Ian > On Wednesday, 7 March 2018 21:39:32 UTC+1, di...@veryhaha.com wrote: >> >> var s uint = 33 >> var u2 = float64

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread digg
get it almost. But I feel var v = float32(1< > On Wed, Mar 7, 2018 at 12:54 PM, Volker Dobler > > wrote: > > Looks suspicious. Without crosschecking the Spec: Might be > > a bug. File an issue? > > It's not a bug. See Andrey's reply. > > Ian > > > > > On Wednesday, 7 March 2018 21:39:

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread digg
On Wednesday, March 7, 2018 at 4:26:19 PM UTC-5, di...@veryhaha.com wrote: > > get it almost. > > But I feel > > var v = float32(1< is a little different to > var v float32 = 1< > > For the former one, we think "1" can be assumed as an "int". > But anyway, I get the main point of the desi

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread Michael Jones
of course you can force it: https://play.golang.org/p/QIWDeMDJlAq On Wed, Mar 7, 2018 at 1:36 PM, wrote: > > > On Wednesday, March 7, 2018 at 4:26:19 PM UTC-5, di...@veryhaha.com wrote: >> >> get it almost. >> >> But I feel >> >> var v = float32(1<> is a little different to >> var v floa

[go-nuts] go get does not create folder

2018-03-07 Thread MLW
Hi Total newbie question but I ave go installed and all the basic hello world example are working fine. However when I use go get to get a remote folder it will not create the folders. So I'm doing go get github.com/golang/example/hello and get this cd .; git clone https://github.com/golang

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread Ian Lance Taylor
On Wed, Mar 7, 2018 at 1:36 PM, wrote: > > On Wednesday, March 7, 2018 at 4:26:19 PM UTC-5, di...@veryhaha.com wrote: >> >> get it almost. >> >> But I feel >> >> var v = float32(1<> is a little different to >> var v float32 = 1<> >> >> For the former one, we think "1" can be assumed as an

[go-nuts] Re: go get does not create folder

2018-03-07 Thread whitaker
Ok Basically I reinstalled Git and allowed some more functionality in the windows cmd terminal. Seems to work now. On Wednesday, March 7, 2018 at 4:00:13 PM UTC-7, Matt Whitaker wrote: > > Hi > > Total newbie question but I ave go installed and all the basic hello world > example are working fi

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread digg
On Wednesday, March 7, 2018 at 6:02:58 PM UTC-5, Ian Lance Taylor wrote: > > On Wed, Mar 7, 2018 at 1:36 PM, > > wrote: > > > > On Wednesday, March 7, 2018 at 4:26:19 PM UTC-5, di...@veryhaha.com > wrote: > >> > >> get it almost. > >> > >> But I feel > >> > >> var v = float32(1< >>

Re: [go-nuts] Re: [ANN] Get Programming with Go

2018-03-07 Thread Nathan Youngman
Hi Matthew, First of all, thanks for looking at the free chapters and providing feedback. I think I should reword the paragraph about the data centre, because there is what Go was initially announced as, and then there is the niche that it now occupies -- the later being predominately network ser

[go-nuts] golang tcp transport just like nc

2018-03-07 Thread suconghou
linux nc command port to golang in nc , we can do this echo 'my id is 1' > /tmp/1 echo 'my id is 3' > /tmp/3 rm -rf /tmp/2 /tmp/4 server nc -l 19090 < /tmp/1 > /tmp/2 ( if you are in linux not mac this may be ` nc -l -p 19090 ` ) client nc 127.0.0.1 19090 < /tmp/3 > /tmp/4 when fi

[go-nuts] [Advice needed] How to vendor common dependencies for plugins

2018-03-07 Thread Jay Guo
Golang gurus, I'm currently trying to modularize my project with the help of Golang plugin, and I come across this dependency vendoring dilemma. Let's say we have a project layout: - Two different projects in separate repo: `Host` and `Guest` - `Host` depends on package `pkgA` - `Guest

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread Volker Dobler
On Thursday, 8 March 2018 00:02:58 UTC+1, Ian Lance Taylor wrote: > > > If we ignore the type context, then > > var v int64 = 1 << s > > fails on 32-bit systems if s > 31 (because 1 is assigned type int, > which is 32 bits, and the shifting a 32-bit value by more than 31 bits > gives you zero)

[go-nuts] stringer tool to generate string to const int conversion

2018-03-07 Thread Randall O'Reilly
I just made a few mods to the stringer tool to generate a function that converts a string back to the const int type, e.g., for this const int type: // SignalType provides standard signals -- can extend by starting at iota + last signal here type SignalType int64 const ( NilSignal