Go Programming Language
that programming language with a rodent mascot.
Created:
Go is the only programming language that has been designed from the ground down. – vzverovich
- Lies we tell ourselves to keep using Golang; Apr 2022.
- An intro to Go for non-Go developers via; 2020-06-11
- Go: the Good, the Bad and the Ugly
- Why Go is no good; Jun 2014. HN1, HN2, shoutout to D.
- Why Go’s design is a disservice to intelligent programmers | Nomad Software; Mar 2015.
- Ten Reasons Why I Don’t Like Golang [July 2016]
- The Codex » I Do Not Like Go;lobste.rs discussion is a balanced discussion.
- The Cost and Complexity of Cgo | Blog | Cockroach Labs, lots of gotchas on that one… FFI is not as simple as one would assume.
- go-is-not-good/README.md at master · ksimka/go-is-not-good - A curated list of articles complaining that go (golang) isn’t good enough
- I Love Go; I Hate Go | HN
- Making the move from Scala to Go, and why we’re not going back | Lobsters
- I don’t get where people get the idea that Go is simple | HN
- Go doesn’t support exception, in syntax. Go has many exceptions, in syntax. * Blog /r/programming
- Bugfender’s issues with using Go - has list of their blog posts.
- Golang sucks // Speaker Deck by Cloudfare Engineers. reddit.
- Why Go and not Rust; Sep 2019.
- The Zen of Go by David Cheney at Gophercon Israel 2020.
- “I thought Go does not have generics?”
- “you shall not have any color!”
- Understanding Real-World Concurrency Bugs in Go [pdf], via HN
Go advocates for making thread creation easy and light-weight and for using message passing over shared memory for inter-thread communication. Indeed, we saw more gor-outines created in Go programs than traditional threads andthere are significant usages of Go channel and other message passing mechanisms. However, our study show that if not used correctly, these two programming practices canpotentially cause concurrency bugs.
Shared memory vs. message passing: Our study found that message passing does not necessarily make multi-threaded programs less error-prone than shared memory.In fact, message passing is the main cause of blocking bugs.To make it worse, when combined with traditional synchro-nization primitives or with other new language featuresand libraries, message passing can cause blocking bugs thatare very hard to detect. Message passing causes less non-blocking bugs than shared memory synchronization and sur-prisingly, was even used to fix bugs that are caused by wrongshared memory synchronization. We believe that messagepassing offers a clean form of inter-thread communicationand can be useful in passing data and signals. But they areonly useful if used correctly, which requires programmersto not only understand message passing mechanisms wellbut also other synchronization mechanisms of Go.
Error Handling in Go – “Rob Pike Reinvented Monads”, Jun 2016.
amos - I want off Mr. Golang’s Wild Ride; Feb 2020. Mostly around problems on Windows.
Project structure
- How to start a Go project in 2023 | Ben E. C. Boyter; May 2023.
- The Within Go Repo Layout - Christine Dodrill; Sep 2020.
- Simple Go project layout with modules - Eli Bendersky’s website; Oct 2019
A very common question Go beginners have is “how do I organize my code?”. Some of the things folks are wondering about are:
- How does my repository structure reflect the way users import my code?
- How do I distribute commands (command-line programs that users can install) in addition to code?
- How do modules change the way I organize my code?
- How do multiple packages coexist in a single module?
Moving to Go
History
Learning
The Go Programming Language by Donovan and Kernighan.
- Alikhll/golang-developer-roadmap: Roadmap to becoming a Go developer in 2019
- Learn Go with Tests - Learn Go with tests this is an innovative approach to learning Go. Via tests.
- Go Books
- The Complete Guide to Learning Go - Calhoun.io
- Advise from Go developers to Go programming newbies
- 50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs
- Go by example
- working-with-go
- Network programmign with Go last update Apr 2012.
- Go In 5 Minutes - Short, helpful screencasts for professional Go developers
- quii/learn-go-with-tests: Learn Go with test-driven development
Training
Reading
- Static analysis features of Godoc
- Language Design in the Service of Software Engineering
- The case for Go language – collection of opinion article on Go.
- and some more …
- Ten Useful Techniques in Go
Development practices
The Go team has published official guidelines for organizing / structuring a Go project: https://go.dev/doc/modules/layout This includes recommended project layouts for different kinds of projects: a simple package, a command-line tool, a mix of the two, etc. via
Deployment practices
- Deploying Go servers with Docker
- The Go binary diet – reducing go binary size.
Performance monitoring
User Groups
- Go Steel Programmers - Pittsburg, PA.
Presentations
Libraries
- Go-git discussion about this git client library [esp see gogit].
- webgo.io – inspired by web.py
- Go-LINQ – LINQ for Go.
- Godep – Go package dependency management.
- Gox – Go cross compile tool.
- overseer – Monitorable, gracefully restarting, self-upgrading binaries in Go
Read Code
- reticulum – distributed image and thumbnail server.
- Go by example and it’s source code
- augend – fact database using Riak and Go.
- l3x.github.io golang-code-examples
List of Lists on Go
- Awesome Go – A curated list of awesome Go frameworks, libraries and software.
Editors
- emacs for go 2014/8/28
- Microsoft/vscode-go: An extension for VS Code which provides support for the Go language. – worked out pretty well for me on Mac OSX. I was able to configure all the features including debugging using the “delve” debugger. Has nice snippets feature that can be turned on .
FFI
Garbage Collection
Why Discord is switching from Go to Rust - Discord Blog
In Go, on cache key eviction, memory is not immediately freed. Instead, the garbage collector runs every so often to find any memory that has no references and then frees it. In other words, instead of freeing immediately after the memory is out of use, memory hangs out for a bit until the garbage collector can determine if it’s truly out of use. During garbage collection, Go has to do a lot of work to determine what memory is free, which can slow the program down. These latency spikes definitely smelled like garbage collection performance impact, but we had written the Go code very efficiently and had very few allocations. We were not creating a lot of garbage. After digging through the Go source code, we learned that Go will force a garbage collection run every 2 minutes at minimum. In other words, if garbage collection has not run for 2 minutes, regardless of heap growth, go will still force a garbage collection.
garbage collection - How fast is the go 1.5 gc with terabytes of RAM? - Stack Overflow
3-4ms pauses under 1.6, with about an 8GB heap and 150M allocations/minute.
- Garbage Collection In Go : Part I - Semantics
- Garbage Collection In Go : Part II - GC Traces
- Garbage Collection In Go : Part III - GC Pacing
Concurrency
- Interesting ways of using Go channels | Nomad Software
- Visualizing Concurrency in Go · divan’s blog
- Fun with Concurrency in Golang · Alex Sears
Programming notes
Debugging notes
Build notes
Cross compiling a binary for Linux on Mac.
git clone [email protected]:xyproto/algernon.git
cd algernon
env GOOS=linux GOARCH=amd64 go build
Tools
Package management
Web
- So you want to expose Go on the Internet
- REST Servers in Go: Part 1 - standard library - Eli Bendersky’s website
- valyala/quicktemplate: Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template
Frameworks
Go Blueprint Hello – “Choose your desired features, and we’ll generate the command you can use to create your project.”
blackfyre/wga: Jumping forward ~30 years –
This repositry contains the code for the Web Gallery of Art project. The project is a web application that allows users to browse through a collection of paintings, sculptures and other forms of Art. This project is inteded to shave off the 3 decades of tech debt on the original website and provide a modern, responsive and user friendly experience with the same content.
– study this project and the choices it has made – pocketbase, htmx, bulma, golang, sass, andgoreleaser
anthdm/superkit still in development.
Templating
templ – “A HTML templating language for Go that has great developer tooling.” github
package main
(name string) {
templ Hello<div>Hello, { name }</div>
}
(person Person) {
templ Greeting<div class="greeting">
(person.Name)
@Hello</div>
}