Go AST Viewer - online tool for analysis and visualization of ast

Basic AST Manipulation, Basic AST Traversal in Go - simple technique to modify Go code using AST.

Standard Package Layout - These are seen as big issues in the Go community but there’s another issue that’s rarely mentioned β€” application package layout.

Go best practices, six years in - Hints and practices to manage Golang project.


Type embedding in Go - Go does not provide the typical, type-driven notion of subclassing, but it does have the ability to β€œborrow” pieces of an implementation by embedding types within a struct or interface. In fact, type embedding is product type composition. The article explains basics behind the embedding.

Errors are values - Error handling in Go is different than other functional programming. Usually Either monad helps a lot. Go programmers miss a fundamental point about errors: Errors are values. The article shows a few patterns on error handling with Go.

Constant errors post show up the issue with sentinel error values in Go, it proposes alternative and type-safe solution to express errors using const. The approach advances error declaration and handling towards behaviour-based approach to inspect errors.

Why doesn’t Go have variance in its type system? - It explain what co-, contra- and invariance are and what the implications for Go’s type system would be. In particular, why it’s impossible to have variance in slices.

Go and Sum Data Types - Sum types is a neat feature of some programming languages that lets us specify that a value might take one of several related types, and includes convenient syntax for pattern matching on these types at run-time.

Functional options on steroids - Functional options is a paradigm in Go for clean and extensible APIs popularized by Dave Cheney and Rob Pike. This post is about the practices that appeared around the pattern since it was first introduced.

JSON and struct composition in Go - Say you are decoding a JSON object into a Go struct. It comes from a service that is not under your control, so you cannot do much about the schema. However, you want to encode it differently.

Don’t use Go’s default HTTP client - Go’s http package doesn’t specify request timeouts by default, allowing services to hijack your goroutines. Always specify a custom http.Client when connecting to outside services.

A Simple Web Scraper in Go and Web Scrapping With Golang are easy technic to parse HTML output of website. Most of the online bots are based on same technic to get required information

Iterating Over Slices In Go In Go everything is pass by value. We can pass by value the address of an object or pass by value a copy of an object. That includes function parameters, return values and when iterating over a slice, map or channel.