Re: [go-nuts] Re: Want to know differance between two code snippets defined here

2019-06-07 Thread Burak Serdar
In line 31 you are redeclaring dispatchMux instead of assigning to the global dispatchMux. That still doesn't explain why it is not working when you do it with a function, but maybe there's something else not included in your posted code. On Thu, Jun 6, 2019 at 11:40 PM Manish Champaneri wrote: >

Re: [go-nuts] Re: Want to know differance between two code snippets defined here

2019-06-06 Thread Manish Champaneri
Link to complete project : https://github.com/mchampaneri/go-multihost File that contains this code https://github.com/mchampaneri/go-multihost/blob/master/proxy.go Json file containing site details https://github.com/mchampaneri/go-multihost/blob/master/server.json On Friday, June 7, 2019 at

Re: [go-nuts] Re: Want to know differance between two code snippets defined here

2019-06-06 Thread Burak Serdar
On Thu, Jun 6, 2019 at 9:28 PM Sam Mortimer wrote: > > I suspect it's the classic that I think everyone does at least once - in the > second code block the for loop reuses the same storage on each iteration for > the variable site. Try adding: > site := site > ..just before your append to verif

[go-nuts] Re: Want to know differance between two code snippets defined here

2019-06-06 Thread Sam Mortimer
I suspect it's the classic that I think everyone does at least once - in the second code block the for loop reuses the same storage on each iteration for the variable site. Try adding: site := site ..just before your append to verify this. Cheers, -Sam. On Thursday, June 6, 2019 at 6:49:00 AM