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.

👣 Print struct variables in Go

Learn how to print struct with variable names
introduction strings go-spew

📡 Handle Context Deadline Exceeded error in Go

Learn how to check if a HTTP client returns a request timeout error
http errors

🔄 Convert CSV to JSON in Go

Learn how to transform CSV file data to JSON
introduction file csv json

🗒️ Read a CSV file in Go

Learn how to read a CSV or TSV file line by line or the whole file at once
introduction file csv

📨 Validate an email address in Go

Learn how to validate an email address using standard library
mail

⚙️ Convert interface to string in Go

Learn how to format any value as a string
introduction interface strings

⏲️ Measure execution time in Go

Learn how to measure the time taken by a function
introduction time

📁 List files in a directory in Go

Learn how to list files in a folder in 4 different ways
introduction file

📂 Check if a file exists in Go

Learn how to check if a file exists in Go after or before opening it
introduction file errors

🐛 Handle errors in Go with errors.Is() and errors.As()

Learn how to check error type using errors.Is() and errors.As() functions
introduction errors
1 ... 10 ... 12