Go is currently my language I am spending the most time learning next to Rust and keeping up to date on my Python and Bash knowledge.
Go promotes composition over inheritance.
- Comments documenting declarations should be full sentences.
- Comments should begin with the name of the thing being described and end in a period.
- You can
log.Fatal(err)
when playing with code.- In actual applications you need to decide what you need to do with each error response - bail immediately, pass it to the caller, show it to the user, log it and continue, etc ...
- I can call functions from anywhere if they are in the same package.
- The package “main” tells the Go compiler that the package should compile as an executable program instead of a shared library.
- Note that any type implements the empty interface interface{} because it doesn't have any methods and all types have zero methods by default.
- Simply pushing my source code to GitHub, makes it
go get
table. - Interface types represent fixed sets of methods.
- the prevailing wisdom in Go is to use a flat directory structure and only create new directories when you are building self-contained functionality.
go get
= download the source code to your PC.go install
= download, build, and put it in the path so you can use it.- I don't need to comment all functions as some are self describing. I do need to comment exported functions however.
- What works well is to use Go to create an HTTP API and leave the rest (html templates etc) to a client-side frontend (e.g. React). That gives you the best of both worlds: a fast and lightweight backend in Go with a rich frontend in JS.
- This is a core concept in Go’s type system; instead of designing our abstractions in terms of what kind of data our types can hold, we design our abstractions in terms of what actions our types can execute.
- In Go, as long as you are not sharing data, you don't really have to care about whether something is concurrent or parallel, the runtime takes care of it for you. You just use goroutines, IO transparently happens on a dedicated threadpool, CPU heavy tasks are spread out over the available cores.
- How to edit Go packages locally
- The main sell point of Go is not simplicity, but overall balance and flexibility
- Tour of Go (Solutions)
- Effective Go
- How to Write Go Code
- Go proverbs
- Go internals
- Go 101 - Great book.
- Notes on Go
- Avoiding complexity in Go
- Gopher reading list
- Go Code Review Comments
- Performance without the event loop (2015)
- 7 common mistakes in Go and when to avoid them by Steve Francia
- Performance without the event loop (2015)
- What I learned in 2017 Writing Go
- Golang interfaces
- Go in 5 minutes
- Learn Go with tests
- Using Instruments to profile Go programs
- Design Philosophy On Packaging
- Go best practices, six years in
- Standard Package Layout
- Style guideline for Go packages
- Share memory by communicating
- Go Build Template
- Go for Industrial Programming - Great insights.
- Sum Types in Go
- Gophercises - Free coding exercises for budding gophers.
- Joy Compiler - Translate idiomatic Go into concise JavaScript that works in every browser.
- The Go Type System for newcomers
- Web Assembly and Go: A look to the future (2018)
- How I Learned to Stop Worrying and Love Golang
- List of advices and tricks in the Go's world
- Golang challenge
- dep2nix - Using golang/dep to create a deps.nix file for go projects to package them for nixpkgs.
- GopherCon 2018 - Rethinking Classical Concurrency Patterns - Slides
- Standard Go Project Layout
- Building Web Apps with Go
- Golang Monorepo - Example of a golang-based monorepo.
- Lorca - Build cross-platform modern desktop apps in Go + HTML5.
- Data Structures with Go Language
- go-hardware - Directory of hardware related libs, tools, and tutorials for Go.
- HN: Go 2, here we go (2018)
- gotestsum - Runs tests, prints friendly test output and a summary of the test run.
- Nice example of a small Go CLI tool
- GolangCI-Lint - Linters Runner for Go. 5x faster than gometalinter. Nice colored output. Can report only new issues. Fewer false-positives. Yaml/toml config.
- Nice VS Code Go snippets
- revive - Fast, configurable, extensible, flexible, and beautiful linter for Go.
- Going Infinite, handling 1M websockets connections in Go (2019)
- Awesome Go Linters
- Leaktest - Goroutine Leak Detector.
- Practical Go: Real world advice for writing maintainable Go programs (2018) (HN)
- The State of Go: Feb 2019
- gomacro - Interactive Go interpreter and debugger with generics and macros.
- go2ll-talk - Live coding a basic Go compiler with LLVM in 20 minutes.
- Thoughts on Go performance optimization
- Go Package Store - App that displays updates for the Go packages in your GOPATH.
- Why are my Go executable files so large? Size visualization of Go executables using D3 (2019)
- goweight - Tool to analyze and troubleshoot a Go binary size.
- Go Patterns - Curated list of Go design patterns, recipes and idioms.
- Go Developer Roadmap - Roadmap to becoming a Go developer in 2019.
- Clear is better than clever (2019) (HN)
- Retool - Vendoring for executables written in Go.
- Why Go? – Key advantages you may have overlooked
- Go Creeping In (2019) (HN)
- Getting to Go: The Journey of Go's Garbage Collector (2018)
- Clean Go Code - Reference for the Go community that aims to help developers write cleaner code.
- Go Language Server - Adds Go support to editors and other tools that use the Language Server Protocol (LSP).
- Go talks
- TinyGo - Go compiler for small places.
- Yaegi - Another Elegant Go Interpreter.
- Delve - Debugger for the Go programming language.
- Experiment, Simplify, Ship (2019)
- Go programming language secure coding practices guide
- Ultimate Go study guide (HN)
- Redress - Tool for analyzing stripped binaries.
- Ask HN: Is there a project based book or course on Go for writing web APIs? (2019)
- Data Structure Libraries and Algorithms implementation in Go
- GitHub Actions for Go - Using GitHub Actions as CI effectively for Go.
- NFPM - Simple deb and rpm packager written in Go.
- Why Go and not Rust? (2019) (HN)
- Algorithms implemented in Go (for education)
- go-callvis - Visualize call graph of a Go program using dot (Graphviz).
- goo - Simple wrapper around the Go toolchain.
- Go Cheat Sheet - Overview of Go syntax and features.
- packr - Simple and easy way to embed static files into Go binaries.
- Uber Go Style Guide (HN)
- Interpreting Go (2019)
- gijit - Just-in-time trace-compiled golang REPL. Standing on the shoulders of giants (GopherJS and LuaJIT).
- unconvert - Remove unnecessary type conversions from Go source.
- Gox - Simple Go Cross Compilation.
- Learning Go: Lexing and Parsing (2016)
- Running a serverless Go web application (2019)
- Awesome Go Storage
- Go Modules: v2 and Beyond (2019)
- Let's Create a Simple Load Balancer With Go (2019) (HN)
- The Value in Go's Simplicity (2019) (HN)
- Google OAuth Go Sample Project - Web application
- Go’s features of last resort (2019) (Lobsters) (HN)
- Minigo - Small Go compiler made from scratch. It can compile itself. The goal is to be the most easy-to-understand Go compiler.
- Writing An Interpreter In Go (HN)
- Source Code for Go In Action
- garble - Obfuscate Go builds.
- Using Makefile(s) for Go (2019)
- The Go runtime scheduler's clever way of dealing with system calls (2019) (HN)
- Go Things I Love: Methods On Any Type (2019) (Reddit)
- Golang for Node.js Developers - Examples of Golang examples compared to Node.js for learning.
- Testing in Go: Test Doubles by Example (2019)
- Chime - Go editor for macOS. (HN)
- Go Things I Love: Channels and Goroutines (2020) (HN)
- go-ruleguard - Define and run pattern-based custom linting rules.
- Go by Example - Hands-on introduction to Go using annotated example programs. (Code)
- Introduction to Programming in Go book
- A Chapter in the Life of Go’s Compiler (2020)
- JWT Authorization in Golang (2019)
- govalidate - Validates your Go installation and dependencies.
- Go: Best Practices for Production Environments
- Go Code Review Comments
- A theory of modern Go (2017)
- Golang IO Cookbook
- cob - Continuous Benchmark for Go Project.
- Concurrency in Go - Fundamentals (2018)
- Go + Services = One Goliath Project (2020) (HN)
- Pure reference counting garbage collector in Go (HN)
- JSON to Go - Convert JSON to Go struct. (Code)
- The await/async concurrency pattern in Golang (2020)
- Exposing interfaces in Go (2019)
- Go Error Handling — Best Practice in 2020
- An Introduction To Concurrency In Go (2020)
- Concurrency in Go book (2017)
- PubSub using channels in Go (2020)
- Build Web Application with Golang book
- SOLID Go Design (2016)
- Better Go Playground - Improved Go Playground powered by Monaco Editor and React.
- Algorithms with Go course
- Interfaces in Go (2018) - Interface is a great and only way to achieve Polymorphism in Go.
- Allocation efficiency in high-performance Go services (2017)
- service-training - Training material for the service repo.
- How I write Go HTTP services after seven years (2018)
- Let's Go! Learn to Build Professional Web Applications With Golang
- Go's Tooling Is an Undervalued Technology (2020) (HN)
- GoProxy - Global proxy for Go modules. (Web)
- Adrian Cockcroft: Communicating Sequential Goroutines (2016)
- Go FAQ
- gosec - Golang Security Checker.
- Inlined defers in Go (2020)
- Andre Carvalho - Understanding Go's Memory Allocator (2018) (Video)
- Make resilient Go net/http servers using timeouts, deadlines and context cancellation (2020) (Lobsters)
- tparse - Command line tool for analyzing and summarizing go test output.
- Go Walkthrough - Series of walkthroughs to help you understand the Go standard library better.
- Go modules by example
- curl-to-Go - Instantly convert curl commands to Go code. (Code)
- Best Practices for Errors in Go (2014)
- Go command overview
- Functional options on steroids (2020) (Reddit)
- Go internals: capturing loop variables in closures (2020)
- go-mod-upgrade - Update outdated Go dependencies interactively.
- go: observing stack grow and shrink (2020)
- Readiness notifications in Go (2020)
- GoReleaser - Deliver Go binaries as fast and easily as possible.
- Zen of Go - Ten engineering values for writing simple, readable, maintainable Go code. (Code) (HN)
- go-clean-arch - Go Clean Architecture based on Reading Uncle Bob's Clean Architecture.
- Why Discord is switching from Go to Rust (2020) (HN) (Reddit) (Lobsters)
- Running Go CLI programs in the browser (2020) (Lobsters)
- GoDays Go talks (2020)
- Golang basics - writing unit tests (2017)
- Buffered channels in go: tips & tricks (2020)
- The Evolution of a Go Programmer
- Staticcheck - Collection of static analysis tools for working with Go code.
- Go Diagnostics
- Experience report on a large Python-to-Go translation (HN)
- profefe - Collect profiling data for long-term analysis.
- Go support for Mobile devices
- Go for Cloud (2020)
- Why are my Go executable files so large? - Size visualization of Go executables using D3.
- Testing in Go: Clean Tests Using t.Cleanup (2020)
- Go Up - Checks if there are any updates for imports in your module.
- I want off Mr. Golang's Wild Ride (2020) (HN)
- Early Impressions of Go from a Rust Programmer (2020)
- Install go tools from modules with brew-gomod (2020)
- Illustrated Tales of Go Runtime Scheduler (2020)
- Google Cloud Platform Go Samples
- prealloc - Go static analysis tool to find slice declarations that could potentially be preallocated.
- Why you shouldn't use func main in Go (Lobsters)
- Diago - Visualization tool for CPU profiles and heap snapshots generated with
pprof
. - pkgviz-go - Generate a vizualization of a Go package's types.
- Setup for Your Next Golang Project (HN)
- HN: Go Turns 10
- Benchmarking Go programs (2017)
- gopkg - Service provides versioned URLs that offer the proper metadata for redirecting the go tool onto well defined GitHub repositories. (Code)
- Go Binaries - On-demand binary server, allowing non-Go users to quickly install tools written in Go without installing go itself. (Article)
- gosize - Analyze size of Go binaries.
- tre - LLVM backed Go compiler.
- Statically compiling Go programs (2020)
- Understanding bytes in Go by building a TCP protocol (2020)
- Go Quirks (2020)
- Debugging with Delve (HN)
- GoDoc Tricks (Code)
- Thanos Coding Style Guide
- faillint - Report unwanted import path and declaration usages.
- Broccoli - Using brotli compression to embed static files in Go.