Live data from Hacker News

Go Replaces Interface{} with 'Any'

github.com

21–30 of 481 posts

Re: Go Replaces Interface{} with 'Any'

#23
post #20

Earlier quoted context omitted.

There is lots of tutorial-style documentation on modules: https://go.dev/doc/#developing-modules There is also a tutorial on generics: https://go.dev/doc/tutorial/generics

I tried doing the modules tutorial a while back but had difficulty with the directory structure. At some point I think the "recommended" directory structure became mandatory and I don't think my personal dev environment ever quite lined-up with it. Perhaps I should wait another year then buy a book.

Modules don't require any particular directory structure, just a go.mod at the root of your project.

Re: Go Replaces Interface{} with 'Any'

#24
post #3

Earlier quoted context omitted.

How is generics not a big enough change to warrant 2.0? Edit: I’m impressed generics aren’t a breaking change! I thought this changed Interface{} to Any as a breaking change

See https://semver.org/ for more details. https://0ver.org/ is fairly popular, and I see https://calver.org/ pretty often too.

0ver is parody, right?

Re: Go Replaces Interface{} with 'Any'

#26

Earlier quoted context omitted.

See https://semver.org/ for more details. https://0ver.org/ is fairly popular, and I see https://calver.org/ pretty often too.

0ver is parody, right?

Well there’s a joke somewhere.

Less has my favorite version numbering system. Sequential.

Latest stable release: Version 598

https://www.greenwoodsoftware.com/less/

Re: Go Replaces Interface{} with 'Any'

#29
post #16

So now that go has generics and modules, is there an up-to-date intro for writing cutting-edge Go code for people who are already pretty familiar with the older styles?

While it's good to get up-to-date, I don't think anyone should go re-write code or radically change their programming style to use generics. There's no need to over-complicate things. Anywhere that you're either copy-pasting a bunch, or using code generation might be a good fit for generics.

Re: Go Replaces Interface{} with 'Any'

#30

Earlier quoted context omitted.

See https://semver.org/ for more details. https://0ver.org/ is fairly popular, and I see https://calver.org/ pretty often too.

0ver is parody, right?

Yes - https://0ver.org/about.html

“ZeroVer is satire, please do not use it”

Post reply on HN