Golang Code Examples

Learn Golang programming by example. GOSAMPLES is a library of Golang code snippets that let you solve everyday code problems.

🔢 Generate a random number in Go

Learn how to generate a random number
introduction random

🍃 Get, set, list and other operations on environment variables in Golang

Learn how to work with environment variables
introduction environment variables

💤 While loop in Golang

Learn how to construct the popular programming while loop
introduction loop

🪓 Split a string in Go

Learn how to split a string by comma or any other separator in Go
introduction strings

⛓️ URL Decode in Go

Learn how to URL decode a path and query parameters in Go
introduction encoding url