Learn how to print the local outbound IP address of your machine| gosamples.dev
Generate and use Universally Unique Identifier in your app| gosamples.dev
Learn how to use the popular time.Ticker struct in loops| gosamples.dev
Learn how to set a time limit for the execution of an HTTP request| gosamples.dev
To handle an HTTP timeout error in Go (Golang), use the os.IsTimeout() function. It returns true if the request time limit has been exceeded| gosamples.dev
Learn what it is for and how to use the built-in recover() function| gosamples.dev
To compare two strings in Go (Golang), use the comparison operators ==, !=, >=, <=, <, >. Alternatively, you can use the 'strings.Compare()' function| gosamples.dev
To exit an application in Go (Golang), use the 'os.Exit()' function from the 'os' package. It causes the program to terminate immediately| gosamples.dev
Learn how to check Go version in CLI, application, or script| gosamples.dev
To repeat a string in Go (Golang), use the strings.Repeat() function. It multiplies the input string a specified number of times| gosamples.dev
Learn how to get, convert and work with the Unix epoch time| gosamples.dev
In Go (Golang), if you want to make the first letter of each word in the string uppercase, you need to use the 'cases.Title()' function| gosamples.dev
Check which PostgreSQL driver and ORM you can use in your next project| gosamples.dev
Learn how to remove characters that are not letters or numbers from a string| gosamples.dev
Learn how to generate a random string of a fixed length| gosamples.dev
To get the max or min value of various integer types in Go (Golang), use the 'math' package constants, for example, 'math.MaxInt64' or 'math.MinInt64'| gosamples.dev
Calculate the number of years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds between two dates in Go (Golang)| gosamples.dev
Learn how to find "the middle value" of a slice| gosamples.dev
Learn how to calculate mean for a slice of any numeric type| gosamples.dev
Learn how to remove invisible characters from a string| gosamples.dev
Learn what is the best method to read user input| gosamples.dev
Learn how to define a function to accumulate slice values using Generics| gosamples.dev
Learn how to remove elements from a slice that do not meet a certain condition using Generics| gosamples.dev
Learn how to make an universal sorting function using Generics| gosamples.dev
Learn how to get all keys of a map using Generics| gosamples.dev
Learn how to check if a slice contains a given value using Generics| gosamples.dev
Learn how to define min and max functions for any type using Generics| gosamples.dev
Learn how to create and handle an error hierarchy| gosamples.dev
Learn how to create a universal rounding function| gosamples.dev
Learn how to check if a key exists in a map| gosamples.dev
Learn how to print a number with language-specific thousands separator| gosamples.dev
Learn how to pretty print HTTP request and response| gosamples.dev
Learn how to create a slice with unique values| gosamples.dev
Learn how to convert a struct to io.Reader and send it as an HTTP POST request body| gosamples.dev
Learn how to convert a HTTP client response body to string| gosamples.dev
Learn how to sort strings with numbers in natural order| gosamples.dev
Learn how to create SQLite repository and make basic operations| gosamples.dev
Learn the differences between string concatenation methods| gosamples.dev
Learn what it means and how to detect the 'connection reset by peer' error| gosamples.dev
Learn the difference between a string and a byte slice| gosamples.dev
Learn how to find and print the address of a variable or pointer| gosamples.dev
Learn what is the difference between length and capacity of a slice| gosamples.dev
Learn how to take the address of a literal, map value, or function return value| gosamples.dev
Learn how to remove all redundant whitespaces from a string| gosamples.dev
Learn how to detect the 'broken pipe' error when writing an HTTP response| gosamples.dev
Learn how to use iota keyword in constants declaration| gosamples.dev
Learn how to create and use a temporary file or folder| gosamples.dev
Learn how to check if a HTTP client returns a request timeout error| gosamples.dev
Learn how to read a CSV or TSV file line by line or the whole file at once| gosamples.dev
Learn how to measure the time taken by a function| gosamples.dev
Learn how to list files in a folder in 4 different ways| gosamples.dev
Learn how to check if a file exists in Go after or before opening it| gosamples.dev
Learn how to check error type using errors.Is() and errors.As() functions| gosamples.dev
Learn how to create an executable Go program| gosamples.dev
Learn how to create and print double-quoted string| gosamples.dev
Learn how to satisfy io.Reader interface using byte slice| gosamples.dev
Learn what is the difference between empty and nil slice and when to use them| gosamples.dev
Learn how to validate an email address using standard library| gosamples.dev
Learn how to use and understand what the `go get` command does| gosamples.dev
Upgrade all your project's dependencies using the `go get` command| gosamples.dev
Learn how to combine URL elements in Go (Golang) with the url.JoinPath() function and method. Avoid errors and format URLs properly| gosamples.dev
Learn how to write simple end-to-end (e2e) tests in Go (Golang) for HTTP applications using only the httptest.Server from the httptest package| gosamples.dev
Use Time.String() or Time.Format() method to convert any time.Time to string in Go (Golang)| gosamples.dev
Learn how to count elements in a slice that meet certain conditions| gosamples.dev
Learn how to make CRUD operations in PostgreSQL like a pro| gosamples.dev
To convert a string to uppercase in Go (Golang), use the 'strings.ToUpper()' function. Check out the examples| gosamples.dev
Use the Cbrt() function from the 'math' package to find the cube root of a given number in Go (Golang)| gosamples.dev
To find the square root of a specified number in Go (Golang), use the Sqrt() function from the 'math' package| gosamples.dev
To get a max, or min value above zero of the float64, or float32 types in Go (Golang), use the 'math' package constants such as `math.MaxFloat64`, etc.| gosamples.dev
To get the value of the Pi constant in Go (Golang), use the mathematical constant 'math.Pi' from the standard library 'math' package| gosamples.dev
To get a hostname or domain from a URL in Go, read the url string with the url.Parse() function, and then use the url.Hostname() method to get the host| gosamples.dev
To raise a number X to the power of Y in Golang, use the math.Pow(x, y float64) function. To calculate the power of 10, use the math.Pow10(n int) function| gosamples.dev
To create a new empty file in Golang, use the os.Create() function, which creates a new file ready for reading and writing| gosamples.dev
To remove or delete a file in Golang, use the built-in os.Remove() function, which deletes the file with the specified name| gosamples.dev
Learn how to substitute a ternary operator not available in Go| gosamples.dev
Learn how to apply a function to all slice elements using Generics| gosamples.dev
Learn how to read a specific number of bytes from io.Reader| gosamples.dev
Learn how to write a function that checks if a slice has a specific value| gosamples.dev
Learn how to decode Base64 data to a string using encoding/base64 package| gosamples.dev
Learn how to encode strings to Base64 using encoding/base64 package| gosamples.dev
Learn how to create a single or a hierarchy of directories| gosamples.dev