OS in Go? Why Not?
In this article, you'll learn why languages like C have a stronghold over OS development and whether writing an OS using Go is possible.
Comparing database/sql, GORM, sqlx, and sqlc
This article compares the database/sql package with 3 other Go packages, namely: sqlx, sqlc, and GORM. The comparison focuses on 3 key areas – features, ease of use, and performance.
Catching Up With Kat Zien on the Structure of Go Apps in 2023
Let’s say I was asked to build a Go application for a website that hosts raffles. I might end up with a file structure that looks like this: ├── main.go ├── api │ ├── client.go │ ├── raffle.go │ └── user.go ├── database │ ├── client.go │ ├── raffle.go │ └── user.go ├── Dockerfile ├── Makefile ├── go.mod ├── go.sum But is this correct? Or is everything I’ve written here completely wrong? This was a common feeling among Go developers back when Kat Zien gave her 2018 GopherCon US talk How Do You Structure Your Go Apps, a brilliant primer on the subject that has been referenced many t
Getting Started with The database/sql Package
This tutorial will show you how to get started with 'database/sql'. First, you’ll learn how to set up and connect to a database. Then, you’ll implement basic queries – insert new rows, query rows, use prepared statements, and work with the transactions.
Profiling Go Code with GoLand
Read this article to learn how and why to use GoLand profilers, as well as how to interpret the data they provide to improve a sample program's performance and runtime.
Understanding Fuzz Testing in Go
Our latest blog post will teach you how to run fuzz tests in GoLand. You'll also learn about the advantages and disadvantages of fuzzing, and even some advanced fuzzing techniques.
Comprehensive Guide to Testing in Go
This article will cover everything you need to know about Go testing. You will start with a simple testing function, and work through more tools and strategies to help you master testing in Go.
Build a Blog With Go Templates
In this tutorial, you will learn how to use the html/template package to create a blog application.
5 GoLand Shortcuts to Boost Your Productivity
GoLand has many shortcuts for any action you can perform in the IDE. The good news is that you don’t have to learn all of them to be productive. How to choose a keymap Let’s start by choosing the right keymap to ensure that you feel right at home more quickly. By default, GoLand has several predefined keymaps to choose from: Keymaps based on your environment: macOS or Windows/Linux.The IntelliJ IDEA Classic keymap is recommended for users who have experience with IntelliJ IDEA or any other JetBrains IntelliJ-platform-based IDE and have used the IntelliJ/macOS keymap in that IDE.Emacs,
How to increment the major version of a go module using GoLand
Let's look at the workflow of incrementing the major version of a module using the module definition taken from our What's New in GoLand repository: module renameab.le/module go 1.11 Upgrading a module means bumping the version tag in version control. We also need to change our import paths. For example, if to bump the module version from `v1` to `v2`, we need our imports changed from: "renameab.le/module/pkg/log" to "renameab.le/module/v2/pkg/log" Obviously, this can appear in lots of places in the code. Good news: the IDE can do this for you. With the 2021.1 version of
How to Use go:embed in Go
One of the most anticipated features of Go 1.16 is the support for embedding files and folders into the application binary at compile-time without using an external tool. This feature is also known as go:embed, and it gets its name from the compiler directive that makes this functionality possible: //go:embed. With it, you can embed all web assets required to make a frontend application work. The build pipeline will simplify since the embedding step does not require any additional tooling to get all static files needed in the binary. At the same time, the deployment pipeline is predictable
Compile and run Go code using WSL 2 and GoLand
Today, I'm happy to introduce our latest feature to you to use Windows Subsystem for Linux version 2 (WSL 2, or simply WSL) to run or test Go applications seamlessly. This feature is called Run Targets and supports WSL 2, Docker, and SSH remotes. If you'd like to learn more about these, the overview article of this feature, explaining it in more detail, should come in handy. In this article, I'll focus on the WSL 2 side of this feature. If you wish to use other targets, you can check the article covering the Docker target. If you'd prefer a video version of this article, then please head t