<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Go on maladroit.dev</title><link>https://maladroit-dev-398201.gitlab.io/tags/go/</link><description>Recent content in Go on maladroit.dev</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://maladroit-dev-398201.gitlab.io/tags/go/index.xml" rel="self" type="application/rss+xml"/><item><title>Go</title><link>https://maladroit-dev-398201.gitlab.io/kb/computer-engineering/go-programming-language/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://maladroit-dev-398201.gitlab.io/kb/computer-engineering/go-programming-language/</guid><description>&lt;h1 id="go"&gt;Go&lt;/h1&gt;
&lt;p&gt;Go is a statically typed, compiled high-level programming language designed at
Google. It shares similarities with C, but has memory safety, garbage
collection, structural typing, and concurrency.&lt;/p&gt;</description></item><item><title>Interface</title><link>https://maladroit-dev-398201.gitlab.io/kb/computer-engineering/go-interface/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://maladroit-dev-398201.gitlab.io/kb/computer-engineering/go-interface/</guid><description>&lt;h1 id="interface"&gt;interface&lt;/h1&gt;
&lt;p&gt;Interfaces in Go provide a way to specify the behavior of an object. These
abstractions are satisfied implicitly and do not need a keyword like
&lt;code&gt;implements&lt;/code&gt; to use.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;type&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Reader&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;interface&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;Read&lt;/span&gt;() []&lt;span style="color:#66d9ef"&gt;byte&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;func&lt;/span&gt; (&lt;span style="color:#a6e22e"&gt;io&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;JsonReader&lt;/span&gt;) &lt;span style="color:#a6e22e"&gt;Read&lt;/span&gt;() []&lt;span style="color:#66d9ef"&gt;byte&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// ...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="when-to-use"&gt;When to use&lt;/h2&gt;
&lt;p&gt;While not an exhaustive list, these are some of the most common cases for making
use of interfaces.&lt;/p&gt;
&lt;h3 id="common-behavior"&gt;Common behavior&lt;/h3&gt;
&lt;p&gt;Defining common behavior that multiple types of objects need to define. A good
example of this would be sorting.&lt;/p&gt;</description></item></channel></rss>