• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Go Gotchas

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been using Go irregularly for about a year and I like it a lot. I have yet to really dive in deep with it.

I've found a few "Gotchas" on my own, and wonder if you could share what you think are the biggest gotchas.

The biggest Gotchas I've found is this:



I understand why this is, but I nevertheless make the mistake.
 
Author
Posts: 14
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Gotcha that I had to learn early on is that the application exits when main finishes. Even when there are concurrent goroutines doing work you intend. To avoid that there are ways to make sure main waits for the other work to finish before exiting.

Because of the way Go handles concurrency that can run on multiple threads this seemed like a fairly unique one to Go. We do cover waiting in Go in Practice.

This was one I had to learn the hard way.
 
I don't always make ads but when I do they're tiny
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!