Re: [go-nuts] newbie go question

2017-04-16 Thread ramachandrang
Thank you, Ian. I will give this a shot. I currently solved this by modifying the imported package to accept a *context.Context instead of golang.org/x/net/context.Context. On Friday, April 14, 2017 at 4:09:27 PM UTC-7, Ian Lance Taylor wrote: > > On Fri, Apr 14, 2017 at 3:34 PM, Ramachandran

[go-nuts] Is go/format always expected to output valid Go?

2017-04-16 Thread tejas
It seems the ast package models method receivers as an array, though methods with multiple receivers don't compile. This has a variety of implications-- for example, it makes it possible for go/format to produce invalid code (example ). Is this acceptable?

[go-nuts] Re: Best practice for client API with both context-aware and non-context-aware methods

2017-04-16 Thread Diego Medina
Like others have said, go with #2, and to help those developers who are new to Go, provide easy to find (maybe in the README) examples of what to do when they don't actually have any useful context value to pass. That will save them time searching around to see what context is, what to use it

[go-nuts] Are all Go cross-platform, native, non-cgo UI library projects dead?

2017-04-16 Thread mjy
GXUI is no longer maintained, all other actively maintained projects seem to require dynamic linking and cgo. Is there really nothing around that's written in Go (without cgo), even if it's less versatile than Gtk etc.? What's the main obstacle? -- You received this message because you are

Re: [go-nuts] Re: golang tour - floating point numbers

2017-04-16 Thread Janne Snabb
It does not do this. It would be nice in most cases if it did. But some times extra parenthesis are useful for making some formula easier to read. Janne Snabb sn...@epipe.com On 2017-04-15 01:36, Jesper Louis Andersen wrote: > If I remember correctly, you can just go wild and put in all the >

[go-nuts] Re: Best practice for client API with both context-aware and non-context-aware methods

2017-04-16 Thread Dragos Harabor
#2. It's easy enough to pass context.TODO() to quickly get a client going. On Friday, April 14, 2017 at 5:49:55 PM UTC-7, Jonathan Hall wrote: > > I'm working on a client client API, and am accepting a `context.Context` > argument as the first argument to each function. > > However, for ease of

[go-nuts] Re: Looking for a http router

2017-04-16 Thread Peter Mogensen
On 2017-04-16 19:52, Dragos Harabor wrote: Take a look at https://github.com/pressly/chi Yeah... I actually took a very long look at it, but AFAICS it doesn't support custom methods. I could of course just use the any-method Handle() call and do the method logic in the individual handler,

[go-nuts] Re: Looking for a http router

2017-04-16 Thread Dragos Harabor
Take a look at https://github.com/pressly/chi On Saturday, April 15, 2017 at 9:29:01 AM UTC-7, Peter Mogensen wrote: > > 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

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

2017-04-16 Thread mhhcbon
free thoughts, pick in it, discuss it, let try to be not dogmatic toc - bushigô - example - economic cost - a new language, really ? - imho *bushigô* Heard about the bushido ? The way of the warrior. Sometimes i feel like working with go is about taking the hard way. I think about bushido

[go-nuts] dyd anyone worked with snaps/go ?

2017-04-16 Thread mhhcbon
Hi, looking for resources between go and snaps. Does anyone have the details about those targets specifically ? Worked with it. delivered go app with it. I d like to add it to my delivery system https://github.com/mh-cbon/go-github-release as it seems just a perfect solution, but looking for

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

2017-04-16 Thread mhhcbon
HI, thats really awesome. And your code seems real good at quick look. I must ask one question, just to put things on the table, why make a new rudby written in go like the existing ruby (written in c ?) ? I mean, ruby exists with its advantages / disadvantages, which are well known now. And

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

2017-04-16 Thread T L
On Saturday, April 15, 2017 at 7:18:51 PM UTC+8, Konstantin Khomoutov wrote: > > 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

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

2017-04-16 Thread 刘桂祥
thanks a lot 在 2017年4月16日星期日 UTC+8上午12:22:13,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