Join the Super Friends on a code safari
In Code Club, I get together with a group of my students, friends, and affiliated Gophers every week, and we read and discuss Go code we found on the internet, learning about it and asking and answering questions as we go. Think of it like a book club, but for code.
Check out the Code Club playlist on the Bitfield YouTube channel. Here are a few selected episodes for your enjoyment.
Anusha, Erin, and Jakub take a journey into the GitHub CLI tool, starting at 'func main' and going wherever it leads us. Topics covered: constants, func main, os.Exit, make, slices, maps, channels, goroutines, blank identifier, go statement, function literals.
The code under discussion is here: github.com/cli/cli
Anusha, Erin, and Jakub continue their journey into the GitHub CLI tool. Topics covered: constructor, standard error, terminal control codes, os.Args, slices, Cobra, if statement.
The code under discussion is here: github.com/cli/cli
Anusha, Erin, and Jakub conclude their journey into the GitHub CLI tool. Topics covered: GitHub, os.Args, slice index, Rust, fmt, exec.Command, variadic function, type assertion.
The code under discussion is here: github.com/cli/cli
The Clubbers inspect a sophisticated sFTP server in Go, with an emphasis on testing. Jackson and John explore a world of incomplete information, applying common sense and guesswork to navigate a complex codebase. Topics covered: testing.T, testing.M, filepath.Join, functional options, function signature, os.ModePerm, type conversion, environment variable, os.Setenv, os.Getenv, cuelang.
The code in question is here: github.com/drakkan/sftpgo/blob/v1.1.0/ftpd/ftpd_test.go
The Clubbers continue their inspection of a sophisticated sFTP server in Go, with an emphasis on testing. Jackson and John explore a world of incomplete information, applying common sense and guesswork to navigate a complex codebase. Topics covered: GOOS, GOARCH, Windows, os.TempDir, t.TempDir, x509, testing.T, http.Get.
The code in question is here: github.com/drakkan/sftpgo/blob/v1.1.0/ftpd/ftpd_test.go
The Clubbers continue their inspection of a sophisticated sFTP server in Go, with an emphasis on testing. Jackson and John explore a world of incomplete information, applying common sense and guesswork to navigate a complex codebase. Topics covered: logging, go statement, concurrency, goroutines, TCP.
The code in question is here: github.com/drakkan/sftpgo/blob/v1.1.0/ftpd/ftpd_test.go
The Clubbers continue their inspection of a sophisticated sFTP server in Go, with an emphasis on testing. Jackson and John explore a world of incomplete information, applying common sense and guesswork to navigate a complex codebase. Topics covered: golint, staticcheck, defensive programming, exceptions, runtime errors, logging, time.Sleep, TestMain, t.TempDir.
The code in question is here: github.com/drakkan/sftpgo/blob/v1.1.0/ftpd/ftpd_test.go
The Clubbers continue their inspection a sophisticated sFTP server in Go, with an emphasis on testing. Jackson and John explore a world of incomplete information, applying common sense and guesswork to navigate a complex codebase. Topics covered: t.Error, t.Fatal, spaces and tabs.
The code in question is here: github.com/drakkan/sftpgo/blob/v1.1.0/ftpd/ftpd_test.go
The Clubbers continue their inspection of a sophisticated sFTP server in Go, with an emphasis on testing. Jackson and John explore a world of incomplete information, applying common sense and guesswork to navigate a complex codebase. Topics covered: testify, filepath.Join.
The code in question is here: github.com/drakkan/sftpgo/blob/v1.1.0/ftpd/ftpd_test.go
The Clubbers reach the end of their epic inspection of a sophisticated sFTP server in Go, with an emphasis on testing. Jackson and John explore a world of incomplete information, applying common sense and guesswork to navigate a complex codebase. Topics covered: current directory, working directory, testing, delete file, remove directory, temporary directory, time.Duration, assert, testify, timer, ticker, net.Dial.
The code in question is here: github.com/drakkan/sftpgo/blob/v1.1.0/ftpd/ftpd_test.go
Support for generics is coming to Go, and in this episode we talk about what that means, what it will look like, and we explore some example code using generics.
The 'embed' library is new in Go 1.16, providing a simple, standard way to embed static file assets into your Go binary. The Code Club crew kick the tyres on the new features, and tackle some tricky coding challenges.
Go is very popular for devops and system administration tools. John introduces the panel to his own script project, designed to make it easy to write shell-style scripts and pipelines in Go.
This week, we look at a concurrent chat server in Go, and how it uses channels to avoid data races.
We chat about a Tetris game written in Go… in a rather un-Go-like way. Can we figure out what’s going on?
This week, we look at an AWS Serverless client, and focus on its use of the Ginkgo BDD testing framework (and we chat about test frameworks in general).
The ‘context’ package is something that mystifies many Gophers. Guest host Josh Akeman proceeds to de-mystify what contexts are for, and where and how we might use them, with reference to the Ardan Labs ‘Service’ repo.
Embedded structs and method promotion… say what now? Thom Kling introduces an adorable charts library for Go that he’s been using, and we dive into some interesting Go syntax in its implementation.
Concurrent programming is hard, but it can be done. This week, we look at another BIT mentee project: a concurrent link checker written in Go. We talk HTTP and TLS testing, goroutines and waitgroups, and the ever-present problem of naming things.
We find out how Go's 'math/rand' and 'crypto/rand' work, and we try to generate a number so random that even God can't guess it. Along the way, we consider cleverness, map ordering, and the quantum wave function of the universe.
Bukola, Joy, Evanson, Adebayo, Umang, Michael, and friends build a password validation library test-first in Go. What makes a secure password? Can we measure it? We learn how to crack passwords, and thus how to make passwords hard to crack.
We look at ways to pass options to libraries in Go. Global variables, config structs, variadic parameters, and even functional options (beautifully simple on the surface, baffling under the hood: what could be more Go-like?) Dave, Bryan, Rakesh, Josh, Thibaut, Thiago, and Richard discuss.
We pull some Go programs to pieces and put them back together again (to some extent). Along the way, we talk map performance, programmer laziness, when benchmarks lie, credit card validation, and SODD (Stack Overflow-Driven Development).