-
The “Hello, World!” program is a classic and time-honored tradition in computer programming. It's a simple and complete first program for beginners, and it's a good way to make sure your environment is properly config...
•
By
Gopher Guides
Go
Development
-
This book is designed to introduce you to writing programs with the Go programming language. You'll learn how to write useful tools and applications that can run on remote servers, or local Windows, macOS, and Linux s...
•
By
Gopher Guides
Go
Books
DigitalOcean
Development
-
In this tutorial you'll explore various ways to use the flag package to build different kinds of command-line utilities. You'll use a flag to control program output, introduce positional arguments where you mix flags ...
•
By
Gopher Guides
Go
Development
-
In Go, distributing or deploying your application requires you to build your code into a shareable binary executable. To do this, you can use the Go toolchain to build and install your program. In this tutorial, you w...
•
By
Gopher Guides
Go
-
In this article, we will learn how to compose custom types that have common behaviors, which will allow us to reuse our code. You'll also learn how to implement interfaces for your own custom types that will satisfy i...
•
By
Gopher Guides
Go
Development
-
Methods are Go functions that operate on instances of a specific type. Methods allow you to communicate not only what the data is, but also how that data should be used. Methods are the core concept that makes Go inte...
•
By
Gopher Guides
Development
Go
-
Struct tags are small pieces of metadata attached to fields of a struct that provide instructions to other Go code that works with the struct. When you read information from systems such as databases, or APIs, you can...
•
By
Gopher Guides
Go
Development
-
Structs allow storing data from several variables in a single entity with one name. They allow Go developers to describe the world in which a Go program operates. Instead of reasoning about strings describing a Street...
•
By
Gopher Guides
Development
Go
-
In this tutorial, you will use the Go flag -ldflags to change the value of variables at build time and introduce your own dynamic information into a binary, using a sample application that prints version information t...
•
By
Gopher Guides
Go
Development
-
switch is an alternative conditional statement useful for communicating actions taken by your Go programs when presented with different options. Everything we can write with the switch statement can also be written wi...
•
By
Gopher Guides
Go
Development
-
Go supports cross-platform compiling by building support for multiple platforms directly into the go build tool. By using the GOOS and GOARCH environment variables and build tags, you can control which OS and architec...
•
By
Gopher Guides
Go
Development
-
When writing software in Go you'll be writing functions and methods. You pass data to these functions as arguments. Sometimes, the function needs a local copy of the data, and you want the original to remain unchanged...
•
By
Gopher Guides
Go
Development
-
Panics are unforeseeable errors that will spontaneously terminate and exit a running Go program. Common mistakes are often responsible for creating panics. In this tutorial, we'll examine a few ways that common operat...
•
By
Gopher Guides
Go
Development
-
In Go, a build tag, or a build constraint, is an identifier added to a piece of code that determines when the file should be included in a package during the build process. This allows you to build different versions ...
•
By
Gopher Guides
Go
Development
-
Go has many of the common control flow keywords found in other programming languages such as if, switch, for, etc. One keyword that isn't found in most other programming languages is defer, and though it's less common...
•
By
Gopher Guides
Go
Development
-
In Go, the predefined init() function sets off a piece of code to run before any other part of your package. This code will execute as soon as the package is imported, and can be used when you need your application to...
•
By
Gopher Guides
Go
Development
-
Visibility in the Go programming language means the file space from which a package or other construct can be referenced. In this article, you will learn how to control package visibility, as well as how to protect pa...
•
By
Gopher Guides
Go
Development
-
In the Go programming language, a for loop implements the repeated execution of code based on a loop counter or loop variable. In this tutorial, you will learn how Go’s for loop works, including the three major variat...
•
By
Gopher Guides
Go
Development
-
A variadic function is a function that accepts zero, one, or more values as a single argument. While variadic functions are not the common case, they can be used to make your code cleaner and more readable.
•
By
Gopher Guides
Go
Development
-
A function is a section of code that, once defined, can be reused. Functions are used to make your code easier to understand by breaking it into small, understandable tasks that can be used more than once throughout y...
•
By
Gopher Guides
Go
Development