Go
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.
Commenting Go code
Comments documenting declarations should be full sentences.
Comments should begin with the name of the thing being described and end in a period.
Error checking
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 ...
Notes
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.
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.
Links
Go 101 - Great book.
Go for Industrial Programming - Great insights.
Gophercises - Free coding exercises for budding gophers.
Joy Compiler - Translate idiomatic Go into concise JavaScript that works in every browser.
dep2nix - Using golang/dep to create a deps.nix file for go projects to package them for nixpkgs.
Golang Monorepo - Example of a golang-based monorepo.
Lorca - Build cross-platform modern desktop apps in Go + HTML5.
go-hardware - Directory of hardware related libs, tools, and tutorials for Go.
gotestsum - Runs tests, prints friendly test output and a summary of the test run.
GolangCI-Lint - Linters Runner for Go. 5x faster than gometalinter. Nice colored output. Can report only new issues. Fewer false-positives. Yaml/toml config.
revive - Fast, configurable, extensible, flexible, and beautiful linter for Go.
Leaktest - Goroutine Leak Detector.
gomacro - Interactive Go interpreter and debugger with generics and macros.
go2ll-talk - Live coding a basic Go compiler with LLVM in 20 minutes.
Go Package Store - App that displays updates for the Go packages in your GOPATH.
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.
Retool - Vendoring for executables written in Go.
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).
TinyGo - Go compiler for small places.
Yaegi - Another Elegant Go Interpreter.
Delve - Debugger for the Go programming language.
Redress - Tool for analyzing stripped binaries.
GitHub Actions for Go - Using GitHub Actions as CI effectively for Go.
NFPM - Simple deb and rpm packager written in Go.
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.
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.
Minigo - Small Go compiler made from scratch. It can compile itself. The goal is to be the most easy-to-understand Go compiler.
garble - Obfuscate Go builds.
Golang for Node.js Developers - Examples of Golang examples compared to Node.js for learning.
go-ruleguard - Define and run pattern-based custom linting rules.
Go by Example - Hands-on introduction to Go using annotated example programs. (Code)
govalidate - Validates your Go installation and dependencies.
cob - Continuous Benchmark for Go Project.
JSON to Go - Convert JSON to Go struct. (Code)
Better Go Playground - Improved Go Playground powered by Monaco Editor and React.
Interfaces in Go (2018) - Interface is a great and only way to achieve Polymorphism in Go.
service-training - Training material for the service repo.
gosec - Golang Security Checker.
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.
curl-to-Go - Instantly convert curl commands to Go code. (Code)
go-mod-upgrade - Update outdated Go dependencies interactively.
GoReleaser - Deliver Go binaries as fast and easily as possible.
go-clean-arch - Go Clean Architecture based on Reading Uncle Bob's Clean Architecture.
Staticcheck - Collection of static analysis tools for working with Go code.
profefe - Collect profiling data for long-term analysis.
Why are my Go executable files so large? - Size visualization of Go executables using D3.
Go Up - Checks if there are any updates for imports in your module.
prealloc - Go static analysis tool to find slice declarations that could potentially be preallocated.
Diago - Visualization tool for CPU profiles and heap snapshots generated with
pprof
.pkgviz-go - Generate a vizualization of a Go package's types.
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.
faillint - Report unwanted import path and declaration usages.
Broccoli - Using brotli compression to embed static files in Go.
Last updated
Was this helpful?