<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: King Etiosasere</title>
    <description>The latest articles on DEV Community by King Etiosasere (@iyosayi).</description>
    <link>https://dev.to/iyosayi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F274087%2F9cd63644-74ca-400c-9b42-91e0b06b2ea5.png</url>
      <title>DEV Community: King Etiosasere</title>
      <link>https://dev.to/iyosayi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iyosayi"/>
    <language>en</language>
    <item>
      <title>Go for Beginners - Basics</title>
      <dc:creator>King Etiosasere</dc:creator>
      <pubDate>Sat, 22 Feb 2020 09:13:46 +0000</pubDate>
      <link>https://dev.to/iyosayi/go-for-beginners-basics-173d</link>
      <guid>https://dev.to/iyosayi/go-for-beginners-basics-173d</guid>
      <description>&lt;p&gt;This post is a continuation to my GoLang series. Today, we shall be looking at the basics of Go, its syntax and some few inbuilt functions and methods. Let's Go!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SYNTAX&lt;/strong&gt;&lt;br&gt;
The Go syntax is fairly easy and straightforward when reading it. Let's take a look at it&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bgRkWoUn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ba4jtsrmw19eiivtfybj.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bgRkWoUn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ba4jtsrmw19eiivtfybj.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us break down the syntax below:&lt;/p&gt;

&lt;p&gt;1) package main&lt;br&gt;
We start from the package level, were we declare the main package like so. All Go code are started with a package main declaration. Packages are kind of modules and they can only be instantiated once throughout the entire code. Any package declared in the package level gives a global scope and other part of the code have access to that package.&lt;/p&gt;

&lt;p&gt;2) import&lt;br&gt;
The import statement is used to import in-built packages as well as third party packages. "fmt" is Go's specially built in format tool that formats Go code as well as enforce some strict code convention in Go.&lt;/p&gt;

&lt;p&gt;3) func main()&lt;br&gt;
The third part of the source code as seen in the picture above, all our code is written in the main function, from were we can also run our code. &lt;/p&gt;

&lt;p&gt;When we run the function using &lt;em&gt;go run filename.go&lt;/em&gt;, the output is displayed in the terminal window. In our case when we type go run Example.go, the output is displayed in the terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dtco3n4T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a84rn3al1bn7l52olrqf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dtco3n4T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a84rn3al1bn7l52olrqf.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, lets look at how we can declare variables in Go, how they are initialized and how we can perform some operations on them&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VARIABLES&lt;/strong&gt;&lt;br&gt;
To declare variables in Go, it can be done in three ways. Lets take a look at them below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8EQz5zjV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jj4wxtxzg3w68p5khebd.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8EQz5zjV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jj4wxtxzg3w68p5khebd.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1) var dev int&lt;br&gt;
   i = 42&lt;br&gt;
Let's break down that above. First, we declare the variable using the &lt;em&gt;var&lt;/em&gt; keyword along side the name of the variable, in this case we are using &lt;em&gt;dev&lt;/em&gt; as the variable name. The &lt;em&gt;int&lt;/em&gt; keyword specifies the data type which translates to an integer in this case.&lt;/p&gt;

&lt;p&gt;2) var myNumber int = 100&lt;br&gt;
Looking at the second declaration, we declare the variable name which is &lt;em&gt;myNumber&lt;/em&gt; and also initialize it on the same line in which we set it to 100.&lt;/p&gt;

&lt;p&gt;3) myString := "Hello Dev"&lt;br&gt;
The third form of declaring variables is by typing the name of the variable on the left hand side, then using the &lt;strong&gt;:=&lt;/strong&gt; sets the variable and also initialize it. So, Go will know that 'myString' is a string because of the &lt;strong&gt;:=&lt;/strong&gt; symbol which sets a variable and also initialize it to what type of data type the variable is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variable Naming Convention&lt;/strong&gt;&lt;br&gt;
In Go, there are some naming conventions that must be followed.&lt;br&gt;
1) All, variable names must start with a lowercase letter. Any variable that start with uppercase letter signifies to Go that such a variable wants to be exported and available globally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DATA TYPES&lt;/strong&gt;&lt;br&gt;
There are four (4) major data types in Go which are listed below:&lt;br&gt;
1) Basic Types: Numbers, Strings and Boolean&lt;br&gt;
2) Aggregate Types: Array and Struct&lt;br&gt;
3) Reference Types: Pointers, Slices, Map, Functions and Channels&lt;br&gt;
4) Interface Type.&lt;/p&gt;

&lt;p&gt;Above are the Data Types in Go. In the next post, we will look at them in details and how they can be implemented. &lt;/p&gt;

&lt;p&gt;Feel free to leave a comment, and tell me what you think. Have a great weekend!&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Go for Beginners - Installation</title>
      <dc:creator>King Etiosasere</dc:creator>
      <pubDate>Sat, 22 Feb 2020 07:37:20 +0000</pubDate>
      <link>https://dev.to/iyosayi/go-for-beginners-installation-25j3</link>
      <guid>https://dev.to/iyosayi/go-for-beginners-installation-25j3</guid>
      <description>&lt;p&gt;This is a continuation of my Go for Beginners series. Let's look at how we can install Go across different platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MacOS&lt;/strong&gt;&lt;br&gt;
For MacOS users, you can find installation instructions via the official Go website or through this link - &lt;a href="https://tecadmin.net/install-go-on-macos/"&gt;https://tecadmin.net/install-go-on-macos/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;br&gt;
For Window users, you can find installation instructions via the official Go website or through this link - &lt;a href="https://www.freecodecamp.org/news/setting-up-go-programming-language-on-windows-f02c8c14e2f/"&gt;https://www.freecodecamp.org/news/setting-up-go-programming-language-on-windows-f02c8c14e2f/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linux(Ubuntu)&lt;/strong&gt;&lt;br&gt;
For Linux users, you can find the installation instructions via the official Go website or through this link - &lt;a href="https://www.howtoforge.com/how-to-install-go-programming-language-on-linux-ubuntu-debian-centos/"&gt;https://www.howtoforge.com/how-to-install-go-programming-language-on-linux-ubuntu-debian-centos/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Go for Beginners - Introduction</title>
      <dc:creator>King Etiosasere</dc:creator>
      <pubDate>Sat, 15 Feb 2020 11:33:45 +0000</pubDate>
      <link>https://dev.to/iyosayi/go-for-beginners-introduction-39e7</link>
      <guid>https://dev.to/iyosayi/go-for-beginners-introduction-39e7</guid>
      <description>&lt;p&gt;This series is aimed at beginners who are new to GoLang which is termed as a promising language according to JetBrains. We will look at some aspects which make the language nice and simple. So let's start off!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHY GO&lt;/strong&gt;? &lt;br&gt;
Let's consider the basics. According to the official golang.org website, &lt;em&gt;Go is an open source programming language that makes it easy to build simple, reliable, and efficient software&lt;/em&gt;. The language comprises of a simple syntax and it's less verbose compared to Java. It is easy to read and understand but yet powerful. Did you know? Docker is written in Go. That sounds cool right? Which makes learning Go worth it in my own opinion. Also, it supports dynamic type system as well as type safety which results to fewer errors during compile time. &lt;/p&gt;

&lt;p&gt;This is an introduction to my series on Go, stay tuned and if you have any questions, feel free to drop the questions. Let's all learn together!&lt;/p&gt;

</description>
      <category>go</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
