Cookies management by TermsFeed Cookie Consent
Russia has invaded Ukraine and already killed tens of thousands of civilians, with many more raped or tortured. It's a genocide. We need your help. Let's fight back against the Russian regime.
Help Ukraine! Fight the Russian regime!

Go Tutorials & Examples

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

Please consider supporting us by disabling your ad blocker

🙌 Case-insensitive string comparison in Go

Learn how to compare strings in a case-insensitive manner
introduction strings

🏁 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
1 ... 10 ... 11