[go-nuts] Re: Small language change for additional type safety (Go2?)

2022-08-04 Thread Andrew Phillips
Hi Marc, thanks for your comment: > The thing is, if you try to cover this for a mistake, then we can cover every mistake, right? Not at all. I think the idea is to try to catch at compile-time common mistakes, that are easily made, can be missed during testing and can have serious consequence

[go-nuts] Small language change for additional type safety (Go2?)

2022-08-01 Thread Andrew Phillips
Just thought I'd run this one by you... I used to often forget to specify the 2nd variable in a for-range: sum := "" for v := range []string{"1", "2", "3"} { sum += v } luckilly (or because Go is so good at type safety) this generates the error: invalid operation: sum += v

Re: [go-nuts] Issues with time.Time

2022-07-21 Thread Andrew Phillips
Thanks for the feedback. I should explain that efficiency is not (currently) a problem. The thing I love about Go is that there is always a simple and obvious (and reasonably efficient) way to do things. I'm currently call time.Now().UTC() no more than a few thousand times per second and store

[go-nuts] Issues with time.Time

2022-07-17 Thread Andrew Phillips
I've discovered a few problems with time.Time but thought I better discuss here first before creating issues at https://github.com/golang/go/issues (in case I missed something obvious :). These are mainly performance issues, but there is also the serious problem that it is easy to accidentally

[go-nuts] Go generic set with interesting real world applications

2021-01-03 Thread Andrew Phillips
I am an avid user of Go who loves how it makes my life so much easier due to its amazing simplicity. I am thrilled to find that a great deal of progress has been made in adding (simple) generic types and functions to the language, which will make my life even simpler! When I discovered the go2