RECENT ARTICLES
How to Test Code in Go | Golang Project Structure
Testing should be considered an essential part of the software-development process, because it helps to ensure that our code works as expected when handling a wide range of reasonable values as input.So today we are going to look at how to write tests in Go, using the built-in syntax, and how to run the tests — as well as how to use other testing frameworks.Table of ContentsThe Go programming language has built-in support for unit testing, which makes it extremely easy to write and run tests for our code.The central idea behind unit testing is that code can be broken down into small...…Testing should be considered an essential part of the software-development process, because it helps to ensure that our code works as expected when handling a wide range of reasonable values as input.So today we are going to look at how to write tests in Go, using the built-in syntax, and how to run the tests — as well as how to use other testing frameworks.Table of ContentsThe Go programming language has built-in support for unit testing, which makes it extremely easy to write and run tests for our code.The central idea behind unit testing is that code can be broken down into small...WW…
Companies Using Go Code in Production Right Now | Golang Project Structure
We spend a lot of time on this blog thinking about things like syntax and code style, or building example projects, but today I want to zoom out and look at Go programming from a bigger perspective.Since Go is one of the most popular languages being used in GitHub repositories, I thought it would be interesting to explore in this post how some major companies and global corporations have used the Go programming language in their work.Table of ContentsThe Go programming language is completely open-source, but the language has its origins at Google, so it’s hardly surprising that the company...…We spend a lot of time on this blog thinking about things like syntax and code style, or building example projects, but today I want to zoom out and look at Go programming from a bigger perspective.Since Go is one of the most popular languages being used in GitHub repositories, I thought it would be interesting to explore in this post how some major companies and global corporations have used the Go programming language in their work.Table of ContentsThe Go programming language is completely open-source, but the language has its origins at Google, so it’s hardly surprising that the company...WW…
How to Make Go Structs More Efficient | Golang Project Structure
It may be surprising to learn that two Go structs can contain exactly the same fields and yet one can require more — or less — memory than the other.Since we generally want to ensure that we never use more memory than required, we are going to look at a technique called structure packing and how it can be applied to the Go programming language.Table of ContentsLet’s look at the following example code, which just defines two custom types, one of which is a struct containing three fields:package maintype City uint8const (NewYork City = iotaLondonParisMumbai)type Person struct...…It may be surprising to learn that two Go structs can contain exactly the same fields and yet one can require more — or less — memory than the other.Since we generally want to ensure that we never use more memory than required, we are going to look at a technique called structure packing and how it can be applied to the Go programming language.Table of ContentsLet’s look at the following example code, which just defines two custom types, one of which is a struct containing three fields:package maintype City uint8const (NewYork City = iotaLondonParisMumbai)type Person struct...WW…
Guide to Printing to the Console in Go | Golang Project Structure
Most programs will need to emit some kind of output if they’re going to be useful to the people using them.So today we will look at the various ways to print content to the console in Go, focusing on four related functions in particular.Table of ContentsThe Go standard library’s functions for printing to the console that we will look at are all contained within the "fmt" package.The package name "fmt" is short for the word “format”, since the functions handle the presentation of output as well as actually emitting it to the console.The simplest function that can be used to emit output to...…Most programs will need to emit some kind of output if they’re going to be useful to the people using them.So today we will look at the various ways to print content to the console in Go, focusing on four related functions in particular.Table of ContentsThe Go standard library’s functions for printing to the console that we will look at are all contained within the "fmt" package.The package name "fmt" is short for the word “format”, since the functions handle the presentation of output as well as actually emitting it to the console.The simplest function that can be used to emit output to...WW…
Why Ezoic Is the Best Ad Network To Make Money From Content Online | Golang Project Structure
You may have seen the advertisements that are automatically placed into various sections on many of the pages of this website.The team at Ezoic handles all that for me, allowing me to focus on writing about the things that I care about and sharing what I’ve learnt about coding with other Go developers.So I want to discuss the frankly impressive service provided by Ezoic — and how it could help you boost advertising revenue for any websites you run — before giving you the opportunity to join the ad network for yourself.Table of ContentsIf you monetize a website with Ezoic, you will be known...…You may have seen the advertisements that are automatically placed into various sections on many of the pages of this website.The team at Ezoic handles all that for me, allowing me to focus on writing about the things that I care about and sharing what I’ve learnt about coding with other Go developers.So I want to discuss the frankly impressive service provided by Ezoic — and how it could help you boost advertising revenue for any websites you run — before giving you the opportunity to join the ad network for yourself.Table of ContentsIf you monetize a website with Ezoic, you will be known...WW…
- Total 5 items
- 1