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.

🫶 The 'main()' function, 'main' package and 'main.go' file in Go

Learn how to create an executable Go program

🆔 Generate UUID in Go

Generate and use Universally Unique Identifier in your app

📝 Convert date or time to string in Go

shorts introduction time

✨ 5 different ways to loop over a time.Ticker in Go

Learn how to use the popular time.Ticker struct in loops
introduction time

👑 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

⏰ 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
1 ... 12