Re: [go-nuts] time.Format with "Month Year" format incorrectly displayed

2021-05-11 Thread Tom Limoncelli
On Wed, May 5, 2021 at 5:38 PM Ian Lance Taylor wrote: > > You wrote 2009 where you need to write 2006. > > Ian > I've always felt that the documentation could be more clear about this. The documentation is technically accurate, but frequently leads a new user to assume that (for example) any

[go-nuts] no matching versions for query "latest"

2021-04-12 Thread Tom Limoncelli
My go.* files have gotten into a situation where `go list -mod=mod -u -m -json all` gives an error: $ go list -mod=mod -u -m -json all go list -m: loading module retractions for github.com/juju/utils@v0.0.0-20200116185830-d40c2fe10647: no matching versions for query "latest" If I don't run `go

[go-nuts] Golang mentioned on Penn and Teller: Fool Us?

2021-03-04 Thread Tom Limoncelli
No. Not really. However, on the most recent episode of Penn and Teller: Fool Us (https://www.cwtv.com/shows/penn-teller-fool-us/back-to-the-future/?play=0956383f-3701-4908-8263-a3778e3d2ead) someone drew a picture of Penn. While talking about it, Penn mentioned that Rene French once drew a

[go-nuts] WMI and Go... where to get started?

2021-02-07 Thread Tom Limoncelli
I've been using Unix for decades (and Go since the pre-releases) and now I find myself needing to use Go to talk to the Windows WMI system. There isn't a lot of GO-specific documentation and I could use help figuring out where to get started. Sadly google searches for getting started with WMI are

Re: [go-nuts] x, err = some_func(); if err != nil { } seems awkward

2020-06-14 Thread Tom Limoncelli
Great minds think alike! On Sun, Jun 14, 2020 at 12:56 PM Ian Lance Taylor wrote: > > On Sun, Jun 14, 2020 at 8:25 AM Tom Limoncelli wrote: > > > > On Thu, Jun 4, 2020 at 3:34 PM Ian Lance Taylor wrote: > > > > > > On Thu, Jun 4, 2020 at 8:43 AM wrote:

Re: [go-nuts] x, err = some_func(); if err != nil { } seems awkward

2020-06-14 Thread Tom Limoncelli
On Thu, Jun 4, 2020 at 3:34 PM Ian Lance Taylor wrote: > > On Thu, Jun 4, 2020 at 8:43 AM wrote: > > > > ?? Why not a cleaner syntax e.g. x = some_func () #{ } .. symbol # > > arbitrarily chosen > > Besides what other people have said, it may be of interest to glance > through >

Re: [go-nuts] Go has eliminated most of my off-by-one errors except 0... I mean 1.

2020-06-14 Thread Tom Limoncelli
Thank you for the feedback! I took Jan Mercl's suggestion and wrote the short function to see if it is useful. It is based on C Banning's suggested code. I'm going to start using it on my projects to see if it helps. The module is called "hind":https://github.com/TomOnTime/hind hind.S(x)

[go-nuts] Go has eliminated most of my off-by-one errors except 0... I mean 1.

2020-06-13 Thread Tom Limoncelli
tl;dr: Go's "range" operator has eliminated the most common trap where I make off-by-one errors. The next largest category of off-by-one errors would be eliminated if there was a way to specify the last item in an array. It would also improve a developer's ability to convey intent. ... I've

Re: [go-nuts] Go Documentation

2018-12-20 Thread Tom Limoncelli
On Thu, Dec 20, 2018 at 1:27 AM 伊藤和也 wrote: > Are there any teaching materials to learn how to write go documentations? > Are you looking for documents that can be used to learn go? 1. "A Tour of Go" is a good place to start: https://tour.golang.org/welcome/1 2. Many tutorials are here:

Re: [go-nuts] Re: understanding utf-8 for a newbie

2017-05-07 Thread Tom Limoncelli
I highly recommend "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)"

Re: [go-nuts] what's the max length of an identifier

2017-04-09 Thread Tom Limoncelli
Did the limit in C used to be 5 characters? That would explain "creat()". (That's a bit of trivia I've always wondered about) Tom On Wed, Apr 5, 2017 at 9:16 AM, Ian Lance Taylor wrote: > On Wed, Apr 5, 2017 at 3:57 AM, Jan Mercl <0xj...@gmail.com> wrote: >> On Wed, Apr 5,

[go-nuts] strings.SplitN(x, 1)

2016-07-04 Thread Tom Limoncelli
Does strings.SplitN(x, 1) always return []string{x}? https://play.golang.org/p/3vDg_BFfY9 If so, I think the docs would be more clear if this was spelled out. For example... *** strings.go-OLD Mon Jul 4 15:33:24 2016 --- strings.go Mon Jul 4 15:34:48 2016 *** *** 266,271 ---