<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GoLang Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/golang/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Fri, 02 Oct 2020 21:01:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to install Go programming language on OpenSUSE 15.2?</title>
		<link>https://www.osradar.com/install-go-programming-language-opensuse-15-2/</link>
					<comments>https://www.osradar.com/install-go-programming-language-opensuse-15-2/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Mon, 05 Oct 2020 02:00:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[GoLang]]></category>
		<category><![CDATA[opensuse]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=23999</guid>

					<description><![CDATA[<p>OpenSUSE is a great operating system that comes from the hand of SUSE. That&#8217;s why it&#8217;s a good target for developers all over the world. Also because it is robust and has great support for languages like Go. So in this post, you can learn how to install Go programming language on OpenSUSE 15.2. Go [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-go-programming-language-opensuse-15-2/">How to install Go programming language on OpenSUSE 15.2?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>OpenSUSE is a great operating system that comes from the hand of SUSE. That&#8217;s why it&#8217;s a good target for developers all over the world. Also because it is robust and has great support for languages like Go. So in this post, you can learn how to<strong> install Go programming language on OpenSUSE 15.2.</strong></p>



<p><a href="https://golang.org">Go</a> is an open-source (<a href="https://golang.org/LICENSE">BSD license</a>) <strong>programming language</strong> that was born with the objective of allowing the creation of efficient and easily distributable applications. So, it has binaries for Windows, Mac OS, and of course, for Linux.</p>



<h2>Install Go programming language on OpenSUSE 15.2</h2>



<p>As I mentioned before, OpenSUSE provides great support for different popular languages through a dedicated repository. This repository is not activated but it is very easy to do.</p>



<p>With this repository, we will get recent versions of many programming languages and among them Go.</p>



<p>So, open a terminal and run the following command:</p>



<pre class="wp-block-preformatted">sudo zypper -ar https://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Leap_15.2/ devel</pre>



<p>OpenSUSE manages the repositories according to the priority they have. The lower the first one is, So the newly added repository has to be reprioritized.</p>



<pre class="wp-block-preformatted">sudo zypper mr -p 70 devel</pre>



<p>This ensures that we will always get updates from this repository. Now we have to refresh Zypper&#8217;s cache to accept the repository&#8217;s GPG key.</p>



<pre class="wp-block-preformatted">sudo zypper refresh
Retrieving repository 'devel' metadata -------------------------------------------------------------------------------------------------------------------------------[/]
New repository or package signing key received:
Repository: devel
Key Name: devel:languages:go OBS Project
Key Fingerprint: B619E7E2 4D0ED061 FA14343C AF4CFE4D 307D7BF9
Key Created: Wed Jun 3 00:52:51 2020
Key Expires: Fri Aug 12 00:52:51 2022
Rpm Name: gpg-pubkey-307d7bf9-5ed72ca3
Do you want to reject the key, trust temporarily, or trust always? <a href="r">r/t/a/?</a>:</pre>



<p>Later we can install Go. At the time of writing is the post the last stable version is <code>1.15.2</code></p>



<pre class="wp-block-preformatted">sudo zypper in go1.15
Loading repository data…
Reading installed packages…
Resolving package dependencies…
The following 17 NEW packages are going to be installed:
gcc gcc7 glibc-devel go1.15 go1.15-doc go1.15-race libasan4 libatomic1 libcilkrts5 libgomp1 libitm1 liblsan0 libmpx2 libmpxwrappers2 libtsan0 libubsan0
linux-glibc-devel
The following recommended package was automatically selected:
go1.15-doc
17 new packages to install.
Overall download size: 141.7 MiB. Already cached: 0 B. After the operation, additional 614.1 MiB will be used.
Continue? y/n/v/…? shows all options:</pre>



<p>Now we can check the operation of the command Go, showing the installed version.</p>



<pre class="wp-block-preformatted">go version<br>go version go1.15.2 linux/amd64</pre>



<p>Now we will create the first program.</p>



<h2>The Hello World on Go</h2>



<p>The first thing we have to do is create a folder for all our projects with Go. This folder can be in any location.</p>



<pre class="wp-block-preformatted">mkdir go_projects</pre>



<p>The following is to add some environment variables to the system configuration. To do this, you must edit the file /etc/profile and add the following lines:</p>



<pre class="wp-block-preformatted">export GOPATH=$HOME/go_projects<br>export GOBIN=$GOPATH/bin</pre>



<p>Replace the value of GOPATH with the path of the folder created for Go projects.</p>



<p>Save the changes and close the editor.</p>



<p>To create the first program, we have to create inside the project folder a folder called <code>src</code> and inside another folder with the name of our program.</p>



<p>For example:</p>



<pre class="wp-block-preformatted">mkdir -p ~/go_projects/src/first_program</pre>



<p>Now access your program folder. In this case, it is &#8220;<strong>first_program</strong>&#8220;.</p>



<pre class="wp-block-preformatted">cd ~/go_projects/src/first_program</pre>



<p>And create the source file with extension go.</p>



<pre class="wp-block-preformatted">nano ~/go_projects/src/first_program/helloworld.go</pre>



<p>And start creating code. In our test case, we&#8217;ll just do a hello world.</p>



<pre class="wp-block-preformatted">package main
import "fmt"
func main() {
fmt.Printf("Welcome To 2daygeek\n")
}</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="965" height="183" src="https://www.osradar.com/wp-content/uploads/2020/10/1.png" alt="1.- Hello world program with Go on OpenSUSE 15.2" class="wp-image-24266" srcset="https://www.osradar.com/wp-content/uploads/2020/10/1.png 965w, https://www.osradar.com/wp-content/uploads/2020/10/1-300x57.png 300w, https://www.osradar.com/wp-content/uploads/2020/10/1-768x146.png 768w, https://www.osradar.com/wp-content/uploads/2020/10/1-696x132.png 696w" sizes="(max-width: 965px) 100vw, 965px" /><figcaption>1.- Hello world program with Go on OpenSUSE 15.2</figcaption></figure>



<p>Save the changes and close the editor.</p>



<p>Now compile the program:</p>



<pre class="wp-block-preformatted">go build first_program<br>go install first_program</pre>



<p>This will generate a binary that we can execute:</p>



<pre class="wp-block-preformatted">./first_program</pre>



<p>Output:</p>



<pre class="wp-block-preformatted">Welcome Osradar</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="738" height="98" src="https://www.osradar.com/wp-content/uploads/2020/10/2-1.png" alt="2.- Go working properly" class="wp-image-24267" srcset="https://www.osradar.com/wp-content/uploads/2020/10/2-1.png 738w, https://www.osradar.com/wp-content/uploads/2020/10/2-1-300x40.png 300w, https://www.osradar.com/wp-content/uploads/2020/10/2-1-696x92.png 696w" sizes="(max-width: 738px) 100vw, 738px" /><figcaption>2.- Go working properly</figcaption></figure>



<p>And this way it is possible to get Go on OpenSUSE 15.2</p>



<h2>Conclusion</h2>



<p>GO is a very popular language and every day it is more and more popular. It’s simple but very powerful, besides being open source. As you have seen, its installation is really simple.</p>



<p>Please share this article on your social networks. Also, join our <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener">Telegram Channel</a> and buy us a coffee. Also, visit our <a href="https://www.facebook.com/osradar/" target="_blank" rel="noreferrer noopener">Facebook page</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-go-programming-language-opensuse-15-2/">How to install Go programming language on OpenSUSE 15.2?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-go-programming-language-opensuse-15-2/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to install Go Language on FreeBSD 12?</title>
		<link>https://www.osradar.com/how-to-install-go-language-freebsd-12/</link>
					<comments>https://www.osradar.com/how-to-install-go-language-freebsd-12/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Fri, 06 Mar 2020 00:56:00 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[freebsd12]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[GoLang]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=18767</guid>

					<description><![CDATA[<p>Hi, friends in this post, you will learn how to install Go on FreeBSD 12. This popular programming language is gaining more and more followers every day. Go is an open source (BSD license) programming language that was born with the objective of allowing the creation of efficient and easily distributable applications. So, it has [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-go-language-freebsd-12/">How to install Go Language on FreeBSD 12?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi, friends in this post, you will learn how to install Go on <a href="https://www.osradar.com/tag/freebsd/" target="_blank" rel="noopener noreferrer">FreeBSD</a> 12. This popular programming language is gaining more and more followers every day.</p>
<p><a href="https://golang.org" rel="noopener">Go</a> is an open source (<a href="https://golang.org/LICENSE" rel="noopener">BSD license</a>) programming language that was born with the objective of allowing the creation of efficient and easily distributable applications. So, it has binaries for Windows, Mac OS and of course, for Linux.</p>
<p>One of the main features of Go is the efficiency with which it manages computer resources. To the extent that many claims to be the natural replacement of C.</p>
<p>On the other hand, Go is a compiled language and has a garbage collector that tries to reduce the latency to the minimum guaranteeing optimal performance.</p>
<p>For this and many other reasons is that more and more developers have it as their main language.</p>
<h2>Install Go language on FreeBSD 12</h2>
<p>One of the main advantages of FreeBSD is that it has a large number of packages available from the official repositories. However, not all of them are up-to-date.</p>
<p>So in this post, we will download and install the latest stable version of Go which is 1.14.</p>
<p>First, open a terminal session. Once you have it open, you need to install curl to download Go.</p>
<pre>:~$ sudo pkg install curl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
	curl: 7.67.0
	ca_root_nss: 3.50
Number of packages to be installed: 2
The process will require 4 MiB more space.
1 MiB to be downloaded.
Proceed with this action? [y/N]: y</pre>
<p><figure id="attachment_18776" aria-describedby="caption-attachment-18776" style="width: 691px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18776" src="https://www.osradar.com/wp-content/uploads/2020/03/1.png" alt="1.- Install curl on FreeBSD 12" width="691" height="270" srcset="https://www.osradar.com/wp-content/uploads/2020/03/1.png 691w, https://www.osradar.com/wp-content/uploads/2020/03/1-300x117.png 300w" sizes="(max-width: 691px) 100vw, 691px" /><figcaption id="caption-attachment-18776" class="wp-caption-text">1.- Install curl on FreeBSD 12</figcaption></figure></p>
<p>Once you have installed curl, we can start the download of Go with the following command:</p>
<pre>:~$ curl https://dl.google.com/go/go1.14.freebsd-amd64.tar.gz --output go.tar.gz</pre>
<p><figure id="attachment_18777" aria-describedby="caption-attachment-18777" style="width: 765px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-18777 size-full" src="https://www.osradar.com/wp-content/uploads/2020/03/2.png" alt="2.- Download Go language on FreeBSD 12" width="765" height="144" srcset="https://www.osradar.com/wp-content/uploads/2020/03/2.png 765w, https://www.osradar.com/wp-content/uploads/2020/03/2-300x56.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/2-696x131.png 696w" sizes="(max-width: 765px) 100vw, 765px" /><figcaption id="caption-attachment-18777" class="wp-caption-text">2.- Download Go language on FreeBSD 12</figcaption></figure></p>
<p>When the download is finished we have to unzip it and move it to the /usr/local/ directory</p>
<pre>:~$ tar xvf go.tar.gz
:~$ sudo mv go /usr/local</pre>
<p>Go is ready for action, but it is convenient to make it available globally in our terminal. To do this, you have to edit the profile file.</p>
<pre>:~$ sudo nano ~/.profile</pre>
<p>And add the following content at the end:</p>
<pre>export GOROOT=/usr/local/go 
export GOPATH=$HOME/work/
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH</pre>
<p><figure id="attachment_18778" aria-describedby="caption-attachment-18778" style="width: 608px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18778" src="https://www.osradar.com/wp-content/uploads/2020/03/3.png" alt="3.- Configuring go" width="608" height="260" srcset="https://www.osradar.com/wp-content/uploads/2020/03/3.png 608w, https://www.osradar.com/wp-content/uploads/2020/03/3-300x128.png 300w" sizes="(max-width: 608px) 100vw, 608px" /><figcaption id="caption-attachment-18778" class="wp-caption-text">3.- Configuring go</figcaption></figure></p>
<p>I&#8217;ll explain something quickly. The second line refers to a folder called &#8220;work&#8221; in that folder is where we have to include all our Go projects. Of course, you can replace the name &#8220;work&#8221; with whatever you want.</p>
<p>Save the changes and close the file.</p>
<p>Now you can see the version of Go installed with the following command:</p>
<pre>:~$ go version
go version go1.14 freebsd/amd64</pre>
<p><figure id="attachment_18780" aria-describedby="caption-attachment-18780" style="width: 845px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18780" src="https://www.osradar.com/wp-content/uploads/2020/03/5.png" alt="5.- Go 1.14 installed" width="845" height="189" srcset="https://www.osradar.com/wp-content/uploads/2020/03/5.png 845w, https://www.osradar.com/wp-content/uploads/2020/03/5-300x67.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/5-768x172.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/5-696x156.png 696w" sizes="(max-width: 845px) 100vw, 845px" /><figcaption id="caption-attachment-18780" class="wp-caption-text">5.- Go 1.14 installed</figcaption></figure></p>
<p>This indicates that Go is available from the console no matter where the prompt is located.</p>
<h2>Testing Go</h2>
<p>Now that Go is installed, let&#8217;s do the classic Hello World program to check that everything is okay.</p>
<p>First, we&#8217;ll create the project folders. Remember that it will be inside the work folder. Inside it, the project folder and inside it, the src folder where we will create the source file.</p>
<pre>:~$ mkdir -p $HOME/work/src/hello</pre>
<p>Then, create the source file and add the following content</p>
<pre>:~$ nano ~/work/src/hello/hello.go
package main 
 import "fmt"
 func main() {
 fmt.Printf("hello, world\n")
 }

</pre>
<p><figure id="attachment_18781" aria-describedby="caption-attachment-18781" style="width: 845px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18781" src="https://www.osradar.com/wp-content/uploads/2020/03/5-1.png" alt="5.- Creating the hello world program in Go language" width="845" height="189" srcset="https://www.osradar.com/wp-content/uploads/2020/03/5-1.png 845w, https://www.osradar.com/wp-content/uploads/2020/03/5-1-300x67.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/5-1-768x172.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/5-1-696x156.png 696w" sizes="(max-width: 845px) 100vw, 845px" /><figcaption id="caption-attachment-18781" class="wp-caption-text">5.- Creating the hello world program in Go language</figcaption></figure></p>
<p>Finally, we build the project, compile the source code and execute it:</p>
<pre>:~$ go build hello
:~$ go install hello
:~$ hello
hello, world</pre>
<p><figure id="attachment_18782" aria-describedby="caption-attachment-18782" style="width: 789px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18782" src="https://www.osradar.com/wp-content/uploads/2020/03/6.png" alt="6.- Go language on FreeBSD 12" width="789" height="125" srcset="https://www.osradar.com/wp-content/uploads/2020/03/6.png 789w, https://www.osradar.com/wp-content/uploads/2020/03/6-300x48.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/6-768x122.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/6-696x110.png 696w" sizes="(max-width: 789px) 100vw, 789px" /><figcaption id="caption-attachment-18782" class="wp-caption-text">6.- Go language on FreeBSD 12</figcaption></figure></p>
<p>So, Go is ready to use.</p>
<h2>Conclusion</h2>
<p>There are many programming languages but there is always room for innovation and that is what Go gives us. An efficient language and with the support of a giant like Google.</p>
<p>Please share this post and join <a href="https://t.me/osradar" target="_blank" rel="noopener noreferrer">our Telegram channel.</a></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-go-language-freebsd-12/">How to install Go Language on FreeBSD 12?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-go-language-freebsd-12/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install GO language on CentOS 7</title>
		<link>https://www.osradar.com/install-go-language-on-centos-7/</link>
					<comments>https://www.osradar.com/install-go-language-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 21 Feb 2019 11:16:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[GoLang]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10971</guid>

					<description><![CDATA[<p>Many people are passionate about programming and use Linux as a learning platform for it. In addition, Linux being a free system lends itself to this type of educational projects. However, although it is free, it does not leave aside security and stability, to be a whole software platform. In this sense, it also adapts [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-go-language-on-centos-7/">Install GO language on CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Many people are passionate about programming and use Linux as a learning platform for it. In addition, Linux being a free system lends itself to this type of educational projects. However, although it is free, it does not leave aside security and stability, to be a whole software platform. In this sense, it also adapts to many programming languages that are emerging as an alternative to the existing ones that have dominated the sector for a long time as Java or C++. With this in mind, I will teach you how to install Go on CentOS7.</p>
<p>In the past, <a href="https://www.osradar.com/install-go-language-ubuntu-18-04/" rel="noopener">we&#8217;ve talked</a> about GO. GO is a programming language that is becoming increasingly popular among developers and sysadmin. Initially, it was created by Google but has been expanding to be used by many current developers. It is inspired by <a href="https://www.osradar.com/how-to-compile-a-c-code-on-gnu-linux/" rel="noopener">C++</a> and has binaries for Windows, Linux and Mac OS. It is also open source under the <a href="https://www.osradar.com/how-to-install-gnome-or-plasma5-kde-on-freebsd-12/" rel="noopener">BSD</a> license.</p>
<h2>1.- Upgrade the system</h2>
<p>First of all, it is necessary to make a complete update to the system. For this, run the following command:</p>
<pre>:~$ su
:~# yum update</pre>
<p><figure id="attachment_10973" aria-describedby="caption-attachment-10973" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10973" src="https://www.osradar.com/wp-content/uploads/2019/02/1-15.png" alt="1.- Upgrade the system" width="1365" height="299" srcset="https://www.osradar.com/wp-content/uploads/2019/02/1-15.png 1365w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-300x66.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-768x168.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-1024x224.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-696x152.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-1068x234.png 1068w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-10973" class="wp-caption-text">1.- Upgrade the system</figcaption></figure></p>
<p>The main objective of this is to make your system have the latest security patches available. This way it will be more stable and you will be ready to continue with the process.</p>
<h2>2.- Download and install GO</h2>
<p>CentOS 7 is a 64-bit system, so we will download the corresponding binaries using wget. If you do not have it installed, do it first.</p>
<pre>:~# yum install wget
:~# wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz</pre>
<p><figure id="attachment_10974" aria-describedby="caption-attachment-10974" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10974" src="https://www.osradar.com/wp-content/uploads/2019/02/2-14.png" alt="2.- Download and install GO" width="1365" height="280" srcset="https://www.osradar.com/wp-content/uploads/2019/02/2-14.png 1365w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-300x62.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-768x158.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-1024x210.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-696x143.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-1068x219.png 1068w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-10974" class="wp-caption-text">2.- Download and install GO</figcaption></figure></p>
<p>At the time of writing this post, the latest stable version of GO is 1.11.5. Check the GO website for the latest version.</p>
<p>After doing this, it is necessary to unzip the downloaded folder. We will do it in the <code>/usr/local</code> directory.</p>
<pre>:~# tar -zxvf go1.11.5.linux-amd64.tar.gz -C /usr/local</pre>
<p><figure id="attachment_10975" aria-describedby="caption-attachment-10975" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10975" src="https://www.osradar.com/wp-content/uploads/2019/02/3-14.png" alt="3.- Decompress GO" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2019/02/3-14.png 1366w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-10975" class="wp-caption-text">3.- Decompress GO</figcaption></figure></p>
<p>So that the installation does not have problems. It is necessary to define environment variables. I mean <code>GOROOT</code> and <code>PATH</code>.</p>
<pre>:~# echo 'export GOROOT=/usr/local/go' | tee -a /etc/profile
:~# echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile</pre>
<p>Finally, refresh your bash profile.</p>
<pre>:~# source /etc/profile</pre>
<p><figure id="attachment_10976" aria-describedby="caption-attachment-10976" style="width: 961px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10976" src="https://www.osradar.com/wp-content/uploads/2019/02/4-10.png" alt="4.- Setting the environment variables" width="961" height="183" srcset="https://www.osradar.com/wp-content/uploads/2019/02/4-10.png 961w, https://www.osradar.com/wp-content/uploads/2019/02/4-10-300x57.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/4-10-768x146.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/4-10-696x133.png 696w" sizes="(max-width: 961px) 100vw, 961px" /><figcaption id="caption-attachment-10976" class="wp-caption-text">4.- Setting the environment variables</figcaption></figure></p>
<p>So, test GO.</p>
<h2>3.- Test the installation</h2>
<p>To verify that the installation has been correct, it is first necessary to show the version of GO. To do it, run this command:</p>
<pre>:~# go version
:~# go env</pre>
<p><figure id="attachment_10977" aria-describedby="caption-attachment-10977" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10977" src="https://www.osradar.com/wp-content/uploads/2019/02/5-12.png" alt="5.- Showing the GO version" width="1365" height="571" srcset="https://www.osradar.com/wp-content/uploads/2019/02/5-12.png 1365w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-300x125.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-768x321.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-1024x428.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-696x291.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-1068x447.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-1004x420.png 1004w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-10977" class="wp-caption-text">5.- Showing the GO version</figcaption></figure></p>
<p>However, the best way to check if your GO is correctly installed is to make a program and run it.</p>
<p>First, create a folder where the program will be located.</p>
<pre>:~# mkdir -p src/test
:~# cd src/test</pre>
<p><figure id="attachment_10978" aria-describedby="caption-attachment-10978" style="width: 855px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10978" src="https://www.osradar.com/wp-content/uploads/2019/02/6-11.png" alt="6.- Creating the folder" width="855" height="129" srcset="https://www.osradar.com/wp-content/uploads/2019/02/6-11.png 855w, https://www.osradar.com/wp-content/uploads/2019/02/6-11-300x45.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/6-11-768x116.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/6-11-696x105.png 696w" sizes="(max-width: 855px) 100vw, 855px" /><figcaption id="caption-attachment-10978" class="wp-caption-text">6.- Creating the folder</figcaption></figure></p>
<p>Next, create the file. I will name it test.go.</p>
<pre>:~# nano test.go</pre>
<p>And add the following:</p>
<pre>package main
import "fmt"
func main() {
    fmt.Printf("Hi, I am Angelo. Thanks for visit Osradar\n")
}</pre>
<p><figure id="attachment_10979" aria-describedby="caption-attachment-10979" style="width: 874px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10979" src="https://www.osradar.com/wp-content/uploads/2019/02/7-11.png" alt="7.- Creating a new file to test GO" width="874" height="199" srcset="https://www.osradar.com/wp-content/uploads/2019/02/7-11.png 874w, https://www.osradar.com/wp-content/uploads/2019/02/7-11-300x68.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/7-11-768x175.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/7-11-696x158.png 696w" sizes="(max-width: 874px) 100vw, 874px" /><figcaption id="caption-attachment-10979" class="wp-caption-text">7.- Creating a new file to test GO</figcaption></figure></p>
<p>Finally, run the file.</p>
<pre>:~# go run test.go</pre>
<p><figure id="attachment_10980" aria-describedby="caption-attachment-10980" style="width: 897px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10980" src="https://www.osradar.com/wp-content/uploads/2019/02/8-12.png" alt="8.- GO is running properly" width="897" height="130" srcset="https://www.osradar.com/wp-content/uploads/2019/02/8-12.png 897w, https://www.osradar.com/wp-content/uploads/2019/02/8-12-300x43.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/8-12-768x111.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/8-12-696x101.png 696w" sizes="(max-width: 897px) 100vw, 897px" /><figcaption id="caption-attachment-10980" class="wp-caption-text">8.- GO is running properly</figcaption></figure></p>
<p>So, GO is ready for the action.</p>
<h2>Conclusion</h2>
<p>Learning to program using GO is a good idea these days. The project is quite mature and more and more people are interested in this language. Installing GO on CentOS 7 is not complicated at all.</p>
<p>Please share this post with your friends.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-go-language-on-centos-7/">Install GO language on CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-go-language-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
