Cookies management by TermsFeed Cookie Consent

Go Tutorials & Examples

Learn Go programming by example. GOSAMPLES is a library of Go tutorials and examples that helps you solve everyday code problems.

🏁 Check if a string starts with a substring in Go

Learn how to use strings.HasPrefix() function
introduction strings

✍️ Write to a file in Go

Learn how to write any data to a file
introduction file

📖 Read a file in Go

Learn how to read the content of any file
introduction file

🔢 Generate a random number in Go

Learn how to generate a random number
introduction random

🍃 Environment variables in Go

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

🪓 8 ways to split a string in Go

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

⛓️ URL Decode in Go

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

🔗 URL Encode in Go

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

😴 Sleep function in Go - pause the program execution

Learn how to pause the execution of a current Goroutine
introduction time
1 ... 11 ... 12