#Golang-Basic

29 articles

Introduction and Implementation of Golang Embed

Introduction and Implementation of Golang Embed

Introduction to Embed Packages Since Golang released version 1.16 there is a new feature called Embed.

Get to know the Repository Pattern in Golang

Get to know the Repository Pattern in Golang

In the book Domain-Driven Design, Eric Evans explains that Repository is a mechanism for encapsulating storage, retrieval and search behaviour, which emulates a collection of objects

Get to know Package Context With Value in Golang

Get to know Package Context With Value in Golang

Introduction to the context.WithValue package At the beginning of the context explanation, we know that the context will be created for the first time during initialization using context.

Getting to Know Package Context in Golang

Getting to Know Package Context in Golang

Introduction to package context Context is a package that can store and carry data values, timeout signals and deadline signals.

Get to know the Package Ticker in Golang

Get to know the Package Ticker in Golang

Introduction to the time.Ticker package This Golang package is a package that is used to repeat certain events which will continue to be repeated for a certain time.

Get to know the Package Timer in Golang

Get to know the Package Timer in Golang

Introduction to the time.Timer package time.Timer is a package that deals with times or events that will occur when the process is executed.

How to Overcome Handling Errors in Golang

How to Overcome Handling Errors in Golang

Currently, Santekno will discuss error handling in the Golang language. We will learn from easy handling to some very complex implementations.

Techniques for Creating Mocking Unit Tests in Golang

Techniques for Creating Mocking Unit Tests in Golang

When we create a function or code, sometimes we have difficulty carrying out unit tests at several points that we cannot cover with unit tests.

How to Create Integration Tests in Golang

How to Create Integration Tests in Golang

Carrying out integration tests for APIs means that we must at least be able to run the application first so that integrated testing can be carried out.

How to Create Unit Tests Using the moq Library in Golang

How to Create Unit Tests Using the moq Library in Golang

Carrying out unit tests using this mocking method is usually used if several functions have been carried out in interface format so that we can assume that if we call the interface function we believe that it should produce the correct program.

How to Create Benchmark Units in Golang

How to Create Benchmark Units in Golang

The testing package, apart from containing tools for testing, also contains tools for benchmarking.

How to Create Unit Tests in Golang

How to Create Unit Tests in Golang

Unit Testing Using the Go Library programming is not easy, even the best programmers cannot write programs that work exactly as desired every time.