Skip to content

UBBGDSC/go-workshop

Repository files navigation

Go Workshop

A brief workshop overview. All materials referenced here will be updated continuously.

Installing the workshop tools

Useful standard library packages to explore

  • fmt (output formatting, writing to the console)
  • slices (basic Go slice operations, since Go 1.21)
  • maps (basic Go maps operations, since Go 1.21)
  • strings (basic Go string operations)
  • strconv (efficient string conversion)
  • math (basic math functions)
  • os (operating system features, such as env variable access, file operations and system calls)
  • path and path/filepath (working with slash separated path names)
  • flag (working with command-line flags)
  • math/rand and crypto/rand (insecure and secure, respectively, random generators, first one being much more user friendly)
  • encoding (for encoding data in general, such as Binary, including Little & Big endian, base64, json etc.)
  • encoding/json (JSON writing & parsing, general JSON handling)
  • io (onput output stream interfaces and operations)
  • bufio (buffered input output, helpers for reading streams more conveniently)
  • errors (create and compare errors)
  • testing (testing and benchmarking support)
  • net/http (Go's HTTP library)
  • context (information propagation and cancellation signals)
  • database/sql (interacting with databases)
  • reflect (runtime type analysis and manipulation)
  • unsafe (if you start using this, you know enough about Go)

Go slang

These are things you might want to look up, but don't know their name, which makes them really hard to look up.

Useful materials

  • A Tour of Go pretty much walks through most Go language concepts (perhaps except standard library).
  • Go Blog is the official blog of the people developing Go. Includes a lot of articles about the language, including best practices and release notes of new versions.
  • Golang Cafe made a lot of videos in the past about how to use the standard library effectively, as well as Go concurrency. All the videos are relevant to this day. We warmly recommend watching them, they are extremely insightful.
  • Effective Go is a nice handbook about writing idiomatic Go code.
  • Uber Go Style Guide contains useful information about writing Go in production (check out functional options -- you'll like it a lot).
  • Dave Cheney is a GoD and writes a lot of articles about various Go topics, including common Go coding patterns, performance profiling, low-level language analysis and more.
  • Go 101 is a deep dive into Go's implementation. We recommend this once you're more familiar with the language.
  • Marrio Carrion is a very experienced Software Engineer, making videos largely about Go. His videos require some Go and Software Engineering experience in general.
  • Golang Dojo is a YouTuber talking about Go (but unfortunately seems to be relatively inactive lately), which is more beginner-friendly.
  • Nic Jackson's microservices tutorial is an amazing one to follow along. It is a bit outdated (e.g. using Gorilla as the web framework), but most of the material is still relevant. It's mainly how Alex learned Go before for his first job.
  • This amazing presentation from Rob Pike, one of Go's founders, talking about concurrency and parallelism.
  • Most Gophercon videos. They are available for free on YouTube.

Useful Go open-source projects

When looking for an open-source project, we like going to their github page and see things like the number of stars, latest commits to see if it's actively maintained, and look up online what people say about it. But, there seems to be a general consensus around these projects that they're pretty much industry standard.

Also, and this is very important: look up their dependencies. Ideally, they should not have many dependencies. Zero is ideal.

  • Kubernetes well...
  • Zerolog is a logger you'll probably like.
  • Chi is a nice web framework with zero extra dependencies. We've used Gin and Echo in the past, but if in doubt, Chi should do the trick.
  • Cobra is nice if you develop command-line applications. They suggest Viper for config, but TBH
  • sqlx and to some extent sqlc are what you will likely be using in production to interact with databases. Please, do not use GORM, even if people still say it's cool and you need an ORM. You probably don't.

Useful VSCODE shortcuts

Check out this repository.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages