Re: [go-nuts] runtime.pclntab strippping

2019-04-04 Thread Ian Lance Taylor
On Thu, Apr 4, 2019 at 2:32 PM Steeve Morin wrote: > > We are big Go users on Android and iOS thanks to golang/mobile. > > Lately we were doing some size profiling and stumbled upon runtime.pclntab, > which in our case represents almost 20% of the file size according to bloaty. > Now I understand

[go-nuts] runtime.pclntab strippping

2019-04-04 Thread Steeve Morin
Hey guys, We are big Go users on Android and iOS thanks to golang/mobile. Lately we were doing some size profiling and stumbled upon runtime.pclntab, which in our case represents almost 20% of the file size according to bloaty. Now I understand that it's used for things like runtime.Caller and

[go-nuts] Go binary release script

2019-04-04 Thread Steeve Morin
Hey folks, We've been maintaining our own fork of Go (essentially release+cherry-picks) and thus need to generate the equivalent of the release tgzs found at https://golang.org/dl/. Today we have a custom script that does it since we couldn't find one in the repo, but I'm thinking it must

Re: [go-nuts] How to apply middleware

2019-04-04 Thread Burak Serdar
On Thu, Apr 4, 2019 at 2:44 AM wrote: > > I have modify the middleware to the below but it only work if the handler > function "/protected" is in the main function. > I have many handlers and do not want to put all of them in the main.go. > You suggest i define a struct and use member function

Re: [go-nuts] How to apply middleware

2019-04-04 Thread Burak Serdar
On Thu, Apr 4, 2019 at 1:46 AM wrote: > > changing and using "router.Use(getTokenMW(server))" is validating all the > routes. How can i exclude routes > /oauth2/token and /credentials. I read that populate but i dont get the idea. > Any clew about how to go about this? You can use subrouters:

Re: [go-nuts] A value copy will occur when executing for range xxx?

2019-04-04 Thread Ian Lance Taylor
On Wed, Apr 3, 2019 at 11:50 PM wrote: > > hehe, thanks, so if i want understand deeply, need to look up gc code? No, the language spec is at https://golang.org/ref/spec. Ian > 在 2019年4月3日星期三 UTC+8下午10:34:57,Ian Lance Taylor写道: >> >> On Wed, Apr 3, 2019 at 6:32 AM wrote: >> > >> > thanks! v

Re: [go-nuts] How to apply middleware

2019-04-04 Thread caradke
How about something like this? Unsure about concurrent access to global variables, but if you want to access srv and clientstore from package sw, It'd make sense to me to move srv and clientstore out of main and into a package. howToApplyMiddleware main.go - server server.go - sw handler.go

[go-nuts] Re: Using Closures to Generate Code On the Fly

2019-04-04 Thread jake6502
Looking at https://git.parallelcoin.io/loki/gists/src/commit/d6cabfd0933d0cda731217c371e0295db331ebb1/tailrecursion-generic.md

Re: [go-nuts] go in cloud server

2019-04-04 Thread Shyaka Rene
Thank you very much all, now i start the tutorials to see if I can continue with it. thank you again On Thu, Apr 4, 2019 at 1:32 AM David Riley wrote: > On Apr 3, 2019, at 11:34 AM, Shyaka Rene wrote: > > > > > > Hello. > > I'm new to go, i'm looking for a programming language to replace java.

Re: [go-nuts] A value copy will occur when executing for range xxx?

2019-04-04 Thread Volker Dobler
On Thursday, 4 April 2019 08:49:48 UTC+2, mount...@gmail.com wrote: > > hehe, thanks, so if i want understand deeply, need to look up gc code? > No, that is not necessary for basics like this question here. The compiler implements the language spec and the spec describes how the language works

Re: [go-nuts] How to apply middleware

2019-04-04 Thread afriyie . abraham
I have modify the middleware to the below but it only work if the handler function "/protected" is in the main function. I have many handlers and do not want to put all of them in the main.go. You suggest i define a struct and use member function of the struct, can you elaborate more about for

Re: [go-nuts] How to apply middleware

2019-04-04 Thread afriyie . abraham
changing and using "router.Use(getTokenMW(server))" is validating all the routes. How can i exclude routes /oauth2/token and /credentials. I read that populate but i dont get the idea. Any clew about how to go about this? On Wednesday, April 3, 2019 at 6:47:12 PM UTC+3, Burak Serdar wrote: >

Re: [go-nuts] A value copy will occur when executing for range xxx?

2019-04-04 Thread mountainfpf
hehe, thanks, so if i want understand deeply, need to look up gc code? 在 2019年4月3日星期三 UTC+8下午10:34:57,Ian Lance Taylor写道: > > On Wed, Apr 3, 2019 at 6:32 AM > wrote: > > > > thanks! v must be a value copy,Is this determined by the compiler? > > It's determined by the language definition. > >

Re: [go-nuts] Build problems with modules in Docker

2019-04-04 Thread Marcus Franke
Hello, On Wed, Apr 3, 2019 at 3:49 PM David Riley wrote: > A few things. Responses inline. > Will answer inline aswell > > > I have a Makefile does some simple tasks for building, it creates a > tarball of my code directory and starts a docker build -t job. > > Why make a tarball? You'll