Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-18 Thread andrey mirtchovski
what you're doing has a term: character assassination. please take it elsewhere. there are plenty of forums to air your grievances. On Thu, Jul 18, 2019 at 11:31 PM Space A. wrote: > > Another funny thing and I'm glad that you mentioned, is that "Woman Who Go" > and other known "non-google"

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-18 Thread Space A.
Another funny thing and I'm glad that you mentioned, is that "Woman Who Go" and other known "non-google" initiatives, as you said, were founded or co-founded by "developer advocate" Ashley McNamara. I don't know what kind of contract or collaboration, or relations she had with Google or Google

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-18 Thread Andrey Tcherepanov
Thank you Ian, you reply is very much appreciated. ... what if a compiler would do a bit of helping "magic"? I would suspect it does know that you return a subslice of an allocated array (something that compiler still sees up the call stack). Would it be possible to put a code for "This big

[go-nuts] Re: Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread Florin Pățan
I don't know how this works for vscode, but for GoLand you can write your own syntax-aware custom folding plugin, see this plugin as an example of how to do it: https://plugins.jetbrains.com/plugin/9320-advanced-java-folding This doesn't mean we are not open to new ideas on how to improve the

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-18 Thread andrey mirtchovski
> Funny thing that today Google has announced "official" store for Go-related > merch, which in it's essence is a try to take away even an even tiny business > opportunities for artists who were creating some goods and had a very very > little outcome on this. Now they will have ZERO. really?

[go-nuts] Re: Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread kez . olesen
Thanks! I haven't heard of GoLand before. Looks like the One Line Returns feature is like an 80% solution, I would toggle that on all the time. I'm not sold on completely hiding the error line like you want, but I'll definitely start a thread with that GoLand dev about how hard it would be to

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-18 Thread Space A.
Funny thing that today Google has announced "official" store for Go-related merch, which in it's essence is a try to take away even an even tiny business opportunities for artists who were creating some goods and had a very very little outcome on this. Now they will have ZERO. Well done Google.

Re: [go-nuts] Build kubernetes with gollvm

2019-07-18 Thread Yuan Ting
Thank you. The explanation really makes sense. I think I should modify the source code of etcd, or change to another project that is not so hackful. On Thursday, July 18, 2019 at 10:55:39 PM UTC+8, Ian Lance Taylor wrote: > > On Thu, Jul 18, 2019 at 6:50 AM Yuan Ting > > wrote: > > > > Thank

[go-nuts] Re: Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread Mike Schinkel
> > Are there any editors that support some kind of customisable collapsing > behaviour? Where the above code could be collapsed to something like: > Might be worth reading, commenting on and/or possibly upvoting this feature proposal for GoLand? https://youtrack.jetbrains.com/issue/GO-7747

Re: [go-nuts] Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread kez . olesen
That's cool, having quick actions to do the folding is part way there. Hehe, I am genuinely looking for a 'try' alternative! I think that an editor-supported solution would keep everybody happy. It would let the code be read as if it were written with some syntactic sugar macro, but the code

Re: [go-nuts] Is it a good idea to use atomic operations in setter and getter methods?

2019-07-18 Thread T L
On Friday, July 19, 2019 at 1:01:27 AM UTC+8, Ian Lance Taylor wrote: > > On Thu, Jul 18, 2019 at 8:35 AM T L > > wrote: > > > > For example: > > > > type Page struct { > > views uint32 > > } > > > > func (page *Page) SetViews(n uint32) { > > atomic.StoreUint32(, n) > > } > >

[go-nuts] A unofficial Go error handling proposal

2019-07-18 Thread 'Yongjian Xu' via golang-nuts
Inspired from reading https://github.com/golang/go/issues/32437#issuecomment-50187 After some careful thoughts on various different concerns and criticisms of the existing proposal, I'd want to give a try from a different approach. Using the famous example of CopyFile: func

Re: [go-nuts] Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread Michael Jones
Ha! https://github.com/rstuven/vscode-iferrblocks On Thu, Jul 18, 2019 at 10:32 AM Jim Robinson wrote: > Is it named try? :P > > On Wednesday, July 17, 2019 at 8:37:53 PM UTC-7, Michael Jones wrote: >> >> There is a special “collapse if err != nil blocks plugin for VS code. >> >> On Wed, Jul

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-18 Thread Ian Lance Taylor
On Thu, Jul 18, 2019 at 11:21 AM David Skinner wrote: > > It is my opinion that it is only polite to acknowledge corporate sponsors in > a tangible way. > > The problem is if you have only one corporate sponsor. I know for a fact that > members of the Smythe Group have contributed time to Go

[go-nuts] Re: About the Google logo on the new Go website

2019-07-18 Thread David Skinner
It is my opinion that it is only polite to acknowledge corporate sponsors in a tangible way. The problem is if you have only one corporate sponsor. I know for a fact that members of the Smythe Group have contributed time to Go dev without compensation. Many other people have also made

Re: [go-nuts] Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread Jim Robinson
Is it named try? :P On Wednesday, July 17, 2019 at 8:37:53 PM UTC-7, Michael Jones wrote: > > There is a special “collapse if err != nil blocks plugin for VS code. > > On Wed, Jul 17, 2019 at 5:37 PM > wrote: > >> Context: >> 1. Golang can be very verbose, for example checking if err != nil

Re: [go-nuts] Is it a good idea to use atomic operations in setter and getter methods?

2019-07-18 Thread Ian Lance Taylor
On Thu, Jul 18, 2019 at 8:35 AM T L wrote: > > For example: > > type Page struct { > views uint32 > } > > func (page *Page) SetViews(n uint32) { > atomic.StoreUint32(, n) > } > > func (page *Page) Views() uint32 { > return atomic.LoadUint32() > } > > Keith Randall and Ian Lance Taylor

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-18 Thread Ian Lance Taylor
On Thu, Jul 18, 2019 at 8:35 AM Andrey Tcherepanov wrote: > > > Basically, it's hard to be sure that there isn't any other slice somewhere > > that might permit references to that trailing memory > > Ian, I am kind of curious about this case. I understand that "hard" is not > "impossible", but

[go-nuts] Is it a good idea to use atomic operations in setter and getter methods?

2019-07-18 Thread T L
For example: type Page struct { views uint32 } func (page *Page) SetViews(n uint32) { atomic.StoreUint32(, n) } func (page *Page) Views() uint32 { return atomic.LoadUint32() } Keith Randall and Ian Lance Taylor said that atomic.Load is a memory_order_acquire

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-18 Thread Andrey Tcherepanov
> Basically, it's hard to be sure that there isn't any other slice somewhere that might permit references to that trailing memory Ian, I am kind of curious about this case. I understand that "hard" is not "impossible", but still - if I copy the needed part to a smaller array, how does the GC

Re: [go-nuts] Panic not recovered inside my panic recover function

2019-07-18 Thread T L
see https://go101.org/article/panic-and-recover-more.html for detailed explanations. On Thursday, July 18, 2019 at 12:52:13 PM UTC+8, ZPL wrote: > > Sorry for the bad formatting. > > > recover must be called directly by a deferred function > func logPanic() { > defer func() { > if err :=

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-18 Thread Ian Lance Taylor
On Thu, Jul 18, 2019 at 7:24 AM robfig wrote: > > I was curious if reducing the capacity of slice makes that memory available > to be reclaimed? > > (1) Reducing capacity using a three-index: > > var s = make([]int64, 1e9) > ... add data to s, keeping a count .. > s = s[:n:n] // reduce length

Re: [go-nuts] Build kubernetes with gollvm

2019-07-18 Thread Yuan Ting
Hi Than Thank you for your fix. I have some curious about the difference between the main Go compiler and gollvm. I read gollvm's readme and know that the main difference comes from the efficiency of GC. Is the other difference causes the symbol undefined reference as you mentioned above? Or