Issue
Recently I’ve participated several Go job interviews. The first one asked me How is channel implemented?
, then the second one asked How is goroutine implemented?
. Well as you can guess, the next one asked How is a Go interface implemented?
.
I’ve been using Go for six months, but to be honest I never did care or know these Go internals
.
I tried to learn these by reading the source code of Go, but can’t really understand the quintessence.
So the question is, for a noob in Go, how do I learn the Go internals?
Solution
The most organized collection of internal resources links is probably this:
Other than that, answers to these questions aren’t collected in once place, but they are scattered in different blog posts.
Slice internals: The Go Blog: usage and internals
String internals: The Go Blog: Strings, bytes, runes and characters in Go
Constants internals: The Go Blog: Constants
Reflection insight: The Go Blog: The Laws of Reflection
Interface internals: RSC: Go Data Structures: Interfaces
Channel implementation: Overview on SO: How are Go channels implemented?
Channel internals: Go channel on steroids
Map implementation: Overview on SO: Golang map internal implementation – how does it search the map for a key?; also related: Go's maps under the hood
Map internals: Macro View of Map Internals In Go
Answered By – icza
Answer Checked By – Pedro (GoLangFix Volunteer)