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 disable your ad blocker πŸ™‚. Our ads are not intrusive

⏳ Time difference between two dates in Go

shorts time

πŸ‘€ Get a hostname (domain) from a URL in Go

shorts url

πŸ–– Calculate Median in Go using Generics

Learn how to find β€œthe middle value” of a slice
numbers math generics generics-intro

πŸ‹οΈβ€β™‚οΈ Calculate the power of a number x^y in Go

shorts numbers math

🀏 Calculate arithmetic mean in Go using Generics

Learn how to calculate mean for a slice of any numeric type
numbers math generics generics-intro

🚧 Remove non-printable characters from a string in Go

Learn how to remove invisible characters from a string
strings

🐀 Create a new file in Go

shorts introduction file

🧹 Delete or remove a file in Go

shorts introduction file

πŸ¦₯ Ternary operator in Go

Learn how to substitute a ternary operator not available in Go
introduction syntax

✌️ 4 ways to create or print string with double quotes in Go

Learn how to create and print double-quoted string
introduction strings
1 ... 4 ... 12