How to Format Your Golang Code
Whether you like it or not, Go defines a code style at a language level (which I love), not different style guides per project. This means there’s very little opinion or conflict - and moving between projects is easy. This is very important to Go, as it stresses clarity and consistency as some of the most important factors of code style. So you’ve written some code, but I’ve been told to format it?
Get Status Code from HTTP Request
We won’t go into too much detail about HTTP status codes themselves, but in this post we will talk about how to use the status code after making a request, how to check them as a range and how to print them as text. This is often important so we can check if something was successful or failed. You can always get this data if you have a net/http/Response type (spec).