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.

โณ 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