[go-nuts] why context never been made as keyword rather than api ?

2017-04-15 Thread mhhcbon
hi, The question is in the title, the rationale, all the changes needed to apply on the source code to a add context as a parameter. We may imagine a ctx as a special keyword, where `ctx hello()` would arrange hello body (and so forth recursively) to insert ctx.Done call appropriately (as muc

[go-nuts] Re: why context never been made as keyword rather than api ?

2017-04-15 Thread Viktor Kojouharov
Adding a new keyword would break backwards compatibility On Saturday, April 15, 2017 at 10:21:32 AM UTC+3, mhh...@gmail.com wrote: > > hi, > > > The question is in the title, > > the rationale, all the changes needed to apply on the source code to a add > context as a parameter. > > We may imagin

[go-nuts] Re: why context never been made as keyword rather than api ?

2017-04-15 Thread mhhcbon
Yeah i see, but in my understanding it is not blocking, you are currently repeating a dogmatic mantra. That you declare a var ctx should override the meaning of ctx in following expressions, in such call `ctx call.expr()` there s absolutely no way to mistake about the meaning of ctx, it must be

[go-nuts] Re: memclr optimization and structs

2017-04-15 Thread 'Keith Randall' via golang-nuts
The value being zeroed must not have any pointers. This is a change from 1.7 and is part of the requirement for the hybrid write barrier (part of making garbage collection pauses smaller). On Friday, April 14, 2017 at 4:02:24

[go-nuts] Re: why context never been made as keyword rather than api ?

2017-04-15 Thread mhhcbon
Note, the last idea was totally wrong, you d just do `theCtx1[, returns of hello...] := ctx hello()` etc. within hello, if you want to get the context `thisCtx := ctx.get()` // which returns current/ZeroContext depending On Saturday, April 15, 2017 at 9:21:32 AM UTC+2, mhh...@gmail.com wrote:

Re: [go-nuts] Re: memclr optimization and structs

2017-04-15 Thread Konstantin Khomoutov
On Sat, 15 Apr 2017 01:31:27 -0700 (PDT) "'Keith Randall' via golang-nuts" wrote: > > I've been looking into why some of our code wasn't resulting in the > > memclr optimization originally introduced in response to > > https://github.com/golang/go/issues/5373. [...] > > type Foo struct { > >

Re: [go-nuts] go build -gcflags '-N -l' don't work

2017-04-15 Thread 刘桂祥
go build -gcflags '-N -l' example.go && ./example If I use this to compile example.go it shound disable function inline and the compile code should call ref() in example.go and will call mallocgc runtimestats.Mallocs can see it but it is not. 在 2017年4月14日星期五 UTC+8下午10:01:25,Ian Lance Taylor写道:

Re: [go-nuts] suggestions for the best way to consume Restful services

2017-04-15 Thread Joe Blue
ah i did not knwo it did consumption. gotta try it. thanks !! On Thu, Apr 13, 2017 at 4:35 PM Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Thu, 13 Apr 2017 05:35:57 -0700 (PDT) > Joe Blue wrote: > > > I have to consume 100's of restful services :) > > > > So the only way is

Re: [go-nuts] suggestions for the best way to consume Restful services

2017-04-15 Thread Joe Blue
seems grpc-gateway does not output in the go-swagger format. I wants to publish tuff this way, but also consume it back in. On Sat, Apr 15, 2017 at 4:15 PM Joe Blue wrote: > ah i did not knwo it did consumption. gotta try it. thanks !! > > On Thu, Apr 13, 2017 at 4:35 PM Konstantin Khomoutov <

[go-nuts] Let's build a new language (in Go) together!

2017-04-15 Thread stan001212
Hi, Rooby is a new object oriented language I created recently (written in Go). It looks just like Ruby for now because it's mainly inspired by it. But I want it to be a new language and start developing its own feature when it gets more mature. So I'm looking

[go-nuts] DumpRequestOut output does not include "Content-Length" header when http.NewRequest was created with io.Pipe

2017-04-15 Thread Steffen Wentzel
Hi all, when using httputil.DumpRequestOut, the output produced does not include a "Content-Length" header, instead I see the length encoded as a hex-value. Additionally, the output produced ends with a "0" in my case. Example code (Playground: https://play.golang.org/p/GBm5D8YgjJ): package ma

Re: [go-nuts] go build -gcflags '-N -l' don't work

2017-04-15 Thread peterGo
刘桂祥, Size and alignment guarantees https://golang.org/ref/spec#Size_and_alignment_guarantees A struct or array type has size zero if it contains no fields (or elements, respectively) that have a size greater than zero. Two distinct zero-size variables may have the same address in memory. You h

Re: [go-nuts] go build -gcflags '-N -l' don't work

2017-04-15 Thread peterGo
For this version of your program with type S struct{ B byte } There is an allocation, // example.go package main import ( "runtime" "unsafe" ) type S struct{ B byte } func main() { var stats runtime.MemStats runtime.ReadMemStats(&stats) println(stats.Mallocs) var

[go-nuts] Looking for a http router

2017-04-15 Thread Peter Mogensen
Hi, Having spend quite some time reading up on the available HTTP router/mux-s I a bit surprised that I couldn't find any which: * Just used http.Handler and the Go1.7+ "context" for routing context * Was method aware and allowed for custom methods * Did not only allow strings as router contex

[go-nuts] DumpRequestOut output does not include "Content-Length" header when http.NewRequest was created with io.Pipe

2017-04-15 Thread Tamás Gulácsi
That's chunked encoding. If you want content-length, set it! -- 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 op

[go-nuts] Re: DumpRequestOut output does not include "Content-Length" header when http.NewRequest was created with io.Pipe

2017-04-15 Thread Steffen Wentzel
This makes perfect sense - thank you. Actually I wasn't aware of chunked encoding at all - thanks for pointing it out. Am Samstag, 15. April 2017 21:22:03 UTC+2 schrieb Tamás Gulácsi: > > That's chunked encoding. If you want content-length, set it! -- You received this message because you are s