Posts tagged with: golang

Implementing a simple state machine in Golang

6 min read

In this blog post, we explore the concept of state machines and their benefits in computer science. We provide an overview of how state machines work and how they can be implemented in Go. By using state machines, developers can write more organized, error-resistant code and improve the clarity and structure of their systems.

A Guide to Embedding Static Files in Go using go:embed

4 min read

In this blog post, you will learn how to simplify the deployment and distribution of Go programs by embedding static files directly in their code using go:embed, a new directive introduced in Go 1.16. This post covers the basic syntax of the directive, its limitations, and best practices for using it effectively. By the end of this post, you will have a solid understanding of how to leverage go:embed to streamline your Go programs and improve your deployment process.

How to Authenticate CLI Using OAuth

4 min read

Are you building a CLI that needs to authenticate using OAuth? If so, you'll need to require permission for your access token using OAuth flow. In this article, we'll walk through the process of authenticating a CLI using OAuth and GitHub.

Error handling in Golang

7 min read

Unlike other language, golang does explicit error checking. In golang, errors are values and we can transform any type into error by implementing the error interface which has a single Error() method.