Category: Go

  • var Versus :=

    For a small language, Go has a lot of ways to declare variables. There’s a reason for this: each declaration style communicates something about how the variable is used. Let’s go through the ways you can declare a variable in Go and see when each is appropriate. The most verbose way to declare a variable in…

  • A sample Makefile

    Here’s a sample Makefile to add to our very simple project: Even if you haven’t seen a Makefile before, it’s not too difficult to figure out what is going on. Each possible operation is called a target. The .DEFAULT_GOAL defines which target is run when no target is specified. In our case, we are going to run the build target.…

  • The Go Playground

    There’s one more important tool for Go development, but this is one that you don’t install: The Go Playground

  • The go Command

    Out of the box, Go ships with many development tools. You access these tools via the go command. They include a compiler, code formatter, linter, dependency manager, test runner, and more. As we learn how to build high-quality idiomatic Go, we’ll explore many of these tools throughout the book. Let’s start with the ones that we use to…