Hacker News new | ask | show | jobs
Ask HN: Recommendations for idiomatic Go (Golang) code?
7 points by speedy1034 3434 days ago
Hi,

I'm very fascinated by Go and was wondering which blogs/videos/articles/project would you recommend for "idiomatic" go coding?

I really want to learn Go and I do not want to write Java/JavaScript/whatever using go syntax

3 comments

IMHO the term "idiomatic" is overused. Every programming language has its idioms, and I am sure you'll learn them when working through Go tutorials, books, or courses.

Important here: Empty your teacup if you want to fill in new (different) tea. Try to understand the Go language without falling back to the idioms of other languages. Drop inheritance, generics, exceptions, dot-chaining of statements, and embrace interfaces, explicit error handling, and clear, readable, and maintainable code.

As one of the go proverbs says, "Clear is better than clever."

(All probverbs here: https://go-proverbs.github.io/)

Learn how the language works and what all the basic pieces are.

After that, the standard library is the best source for idiomatic go code.

I believe that the standard libraries are considered idiomatic code examples.