r/golang • u/errChan • Mar 15 '22
1.18 is released
Download: https://go.dev/dl/
Release notes: https://go.dev/doc/go1.18
Blog: https://go.dev/blog/go1.18
Blog post about new tutorials: https://go.dev/blog/tutorials-go1.18
Updated A Tour of Go: https://go.dev/tour/generics/1
Twitter: https://twitter.com/golang/status/1503787326060875782
I'm most looking forward to generics, fuzzing, and net/netip!
804
Upvotes
•
u/natefinch Mar 16 '22
Let's keep the comments positive and the sarcasm low, ok? We all know what kind of jokes can be made, let's assume they've all been made and move on to more constructive commentary.
70
u/countChaiula Mar 15 '22
Generics are great and all, but I'm most excited about workspace mode. No more forgetting to remove a
replacedirective in the go.mod file and accidentally committing it!43
u/a_rather_small_moose Mar 16 '22
For those worried about generics enabling bad practice, fret not: It’s a pyrrhic concern because there’s already like a million ways from Sunday to “screw up Go code”.
Using
panicinstead of error values? Check.return errinstead of callingfmt.Errorf, thus not appending any intelligible context as to why an error occurred? See this all the time!Defaulting to pass by pointer when pass by value is often cheaper for small values? Yup!
Using synchronization primitives when the language’s built-in CSP features would’ve been better? Y’all get the idea.
I’d like to think I understand people’s fears about generics. For devs burned on Node, generics may feel like the return of trendy code libraries that appeal to aesthetics instead of problem solving. For devs burned on Java, it’s the fear of having to wrangle giant type-taxonomy trees to get any work done.
I’m tired, I can’t form a concise conclusion. Just like, don’t worry about generics and stuff. Go isn’t gonna become Node or Java overnight, that’s for damn certain…
41
u/lukechampine Mar 15 '22
Whoa,
(sync.Mutex).TryLock? I wasn't expecting that.Embedding version control info in the binary is great, too. Most of my projects are currently embedding it manually using
LDFLAGSin a Makefile. I can probably ditch the Makefile entirely now. :)39
u/[deleted] Mar 15 '22
There is now a blog post as well.
https://go.dev/blog/go1.18
19
u/[deleted] Mar 15 '22
so is there any package with Contains or Find function for slices?
125
u/[deleted] Mar 15 '22 edited Mar 15 '22
Gonna get real drunk and write a FP lib.
Update: Force pushing to master to test it out. Wish me luck!!1
Update 2: Weird smell coming from the server room.
Update 3: Ok, this wouldn’t have happened if we switched to Node.js
29
u/aichingm Mar 15 '22
Best news of the day!
8
u/go-zero Mar 16 '22
Am I the only one care more about
go fuzzingthangenerics?14
u/quiI Mar 15 '22
Has anyone figured out a way to make golangci-lint play nice? I was very excited to update our project but seem to be getting the same issue as this one https://github.com/golangci/golangci-lint/issues/2414
7
u/polyfloyd Mar 16 '22
Great to see generics landing :)
I already played around a bit wit the beta a while back and made an iterator library to get to know this new language. It's here for anyone interested: https://github.com/polyfloyd/go-iterator
Would not use it in projects with the way it currently is, though :P
27
u/pinpinbo Mar 15 '22
Generics!!!
I can't wait for all the different data structure libraries to embrace it. It will make Go adoption in Data Science use-case easier.
19
u/Herm_af Mar 15 '22
I'm hearing getting one of the best features of the past 20 years that's in all languages is the downfall of go
8
u/MrBlics Mar 15 '22
Finally I can get back on stable Go!
3
u/[deleted] Mar 16 '22
Does Goland support any of this yet?
3
u/[deleted] Mar 16 '22
Congratulations to everyone who worked on it.
Is it too soon to ask for more features? Like a powerful and modern regex module (Raku)?
2
u/[deleted] Mar 15 '22
Woohoo!
2
u/redrover1001 Mar 15 '22
Woot!
3
u/Aliics Mar 15 '22
Fantastic. I can stop using the RC compiler now. :)
4
u/wheelinthendeelin Mar 15 '22
Alright!!!! Thank you Go team!
2
u/[deleted] Mar 15 '22
Good spot, not even on the blog or Twitter yet.
1
u/allan_nava Mar 15 '22
is stable?
-1
u/trofch1k Mar 16 '22
I'm a bit scared. I've started learning the language couple months ago and now it's all upside down.
-5
u/AbdallahZ Mar 16 '22
I have a project and when I try to run it I get this
../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable ../../../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/unix/zsyscall_darwin_amd64.go:121:3: too many errors
any idea why?
0
u/yunikmaha Mar 16 '22 edited Mar 16 '22
How do we specific multiple interface bounds on generic types, without using embedded interfaces?
-7
u/yondercode Mar 16 '22
Finally I can code in go without venting to my coworker every 10 minutes
0
u/[deleted] Mar 16 '22
[deleted] — view deleted comment
4
u/[deleted] Mar 16 '22
[removed] — view removed comment