<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Code on Gopher Coding</title><link>https://gophercoding.com/tags/code/</link><description>Recent content in Code on Gopher Coding</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sun, 02 Apr 2023 12:13:48 +0100</lastBuildDate><atom:link href="https://gophercoding.com/tags/code/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Format Your Golang Code</title><link>https://gophercoding.com/how-to-format-golang-code/</link><pubDate>Mon, 27 Feb 2023 09:30:00 +0000</pubDate><guid>https://gophercoding.com/how-to-format-golang-code/</guid><description>&lt;p>Whether you agree with it or not, Go defines a &lt;a href="https://google.github.io/styleguide/go/guide">code style&lt;/a> at a &lt;strong>language level&lt;/strong> (which I love), and not different styles per project - or having the style as an afterthought! This means there&amp;rsquo;s very little opinion or conflict when moving between projects so it&amp;rsquo;s easy. This is very important to Go, as it stresses &lt;strong>&lt;a href="https://google.github.io/styleguide/go/guide.html">clarity and consistency&lt;/a>&lt;/strong> as some of the most important factors of code style.&lt;/p>
&lt;p>So you&amp;rsquo;ve written some code, and have been told to format it?&lt;/p></description></item><item><title>Get Status Code from HTTP Request</title><link>https://gophercoding.com/get-status-code-from-http-req/</link><pubDate>Sun, 23 Oct 2022 07:00:00 +0000</pubDate><guid>https://gophercoding.com/get-status-code-from-http-req/</guid><description>&lt;p>We won&amp;rsquo;t go into too much detail about &lt;a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status codes&lt;/a> themselves, but in this post we will talk about how to use the &lt;strong>status code&lt;/strong> 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.&lt;/p>
&lt;p>You can always get this data if you have a &lt;code>net/http/Response&lt;/code> type (&lt;a href="https://go.dev/src/net/http/response.go">spec&lt;/a>).&lt;/p></description></item></channel></rss>