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 Code Examples

Learn Go programming by example. GOSAMPLES is a library of Go code snippets that let you solve everyday code problems.

Please consider supporting us by disabling your ad blocker

🐘 Best PostgreSQL database drivers and ORMs in Go

Check which PostgreSQL driver and ORM you can use in your next project
list postgresql db sql

🧽 Remove non-alphanumeric characters from a string in Go

Learn how to remove characters that are not letters or numbers from a string
strings regex

🧊 Cube root in Go

shorts numbers math

🟦 Square root in Go

shorts numbers math

🎲 Generate a random string in Go

Learn how to generate a random string of a fixed length
introduction random strings

🍰 The maximum and minimum value of the int types in Go

shorts numbers math

📊 The maximum and minimum value of the float types in Go

shorts numbers math

🍩 Get Pi constant in Go

shorts numbers math

⏳ Time difference between two dates in Go

shorts time

👀 Get a hostname (domain) from a URL in Go

shorts url
1 ... 10