9. THE AUTHORITATIVE
DOCUMENT
Go at Google: Language Design in the Service of Software
Engineering.
[https://talks.golang.org/2012/splash.article]
(And you'll be stumbling over Plan 9 more than once)
10. SOME DESIGN GOALS
Fast compilation cycles
Simple and concise syntax: easy to read, easy to parse
Familiarity for new developers
Scales well to large code bases
Promote robust and maintainable design
Keep large codebases robust in face of change
Offer maintainable paradigms for multithreading
28. SWISS KNIVE: GO
goas interface to complete toolchain
go get
go build -x
go install
go test -race
go test -coverprofile=c.out
go tool cover -html=c.out
30. "NATIVE" TOOLCHAIN
This is the toolchain referred to in golang release
Rooted in Plan 9 toolchain (assembler, linker)
Used to be C, now Golang (converted from C)
Produces static binaries (not quite true anymore)
OS: Win, Linux, OSX, BSD and friends, Plan 9 (!), ...
Arch: x86, x86-64, ARM(v5678), ppc
Dead simple cross compilation
GOARCH=x86GOOS=windowsgoinstallsome/package
31. GCC FRONTEND
Lags behind native toolchain (currently 1.4 in GCC5)
Relies on GCC & friends for optimization, code
generation and linking
Generates dynamic binaries
Supports anything supported by GCC (MIPS anybody)
Cross compilation: PITA
32. INTERFACING C
Works with CGO: generates glue code
Dynamic dependencies: breaks cross compiling badly :(
BUT: Lots of native go out there :)
33. TESTING, PROFILING
AND CODE COVERAGE
[MARCO]
Testing files located by convention main.go ->
main_test.go
go test -cover -cpuprofile cpu.out -
memprofile mem.out
38. SOLUTION 2:
VENDORING
Record and pin dependencies in per-package manifest
Recursively download deps before build
Needs external tooling and per-package support :(
Popular specimen: glide
40. PERFORMANT SERVERS
Event loop AND threads
Compiled and statically typed
Standard lib covers most networking stuff
Community frameworks for services: go-micro, go-kit