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.

Please consider supporting us by disabling your ad blocker

👑 Go Generics cheatsheet

Learn how to create type-independent functions
cheatsheet generics generics-intro

🫘 Count the occurrences of an element in a slice in Go

Learn how to count elements in a slice that meet certain conditions
introduction generics generics-intro

⏱️ Set HTTP client timeout in Go

Learn how to set a time limit for the execution of an HTTP request
http

⏰ Handle HTTP timeout error in Go

shorts http

❤️‍🩹 Recover function in Go

Learn what it is for and how to use the built-in recover() function
introduction syntax builtin

🐾 How to compare strings in Go

shorts introduction strings

🛑 Exit an app in Go

shorts introduction os

💻 How to check your Go version

Learn how to check Go version in CLI, application, or script
introduction version

🔁 Repeat a string in Go

shorts strings

⌚ Unix time in Go [cheatsheet]

Learn how to get, convert and work with the Unix epoch time
cheatsheet time
1 ... 11