5 common mistakes in Go

Click for: original source

Some common mistakes that can be seen in Go are infinite recursive call, assignment to nil map, undesired value being used in goroutine, and more. By Jai Pradeesh.

Bug-risks are issues in code that can cause errors and breakages in production. A bug is a flaw in the code that produces undesired or incorrect results. Code often has bug-risks due to poor coding practices, lack of version control, miscommunication of requirements, unrealistic time schedules for development, and buggy third-party tools. In this post, let’s take a look at a few commonly seen bug-risks in Go.

The article then mentions these mistakes:

  • Infinite recursive call
  • Assignment to nil Map
  • Method modifies receiver
  • Possibly undesired value being used in goroutine
  • Deferring close before checking for a possible error

The article also offers links to further reading. Short and sweet!

[Read More]

Tags learning programming app-development golang