{"id":16036,"date":"2024-09-03T14:14:30","date_gmt":"2024-09-03T10:44:30","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=16036"},"modified":"2024-09-03T14:14:30","modified_gmt":"2024-09-03T10:44:30","slug":"how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/","title":{"rendered":"How to install Go and set up a local development environment on Ubuntu 18.04"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">Introduction<\/h2>\n<p>Go is a programming language born out of frustration at Google. Developers were constantly forced to choose between a language that ran efficiently but took a long time to compile, or a language that was easy to program in but inefficient in production. Go was designed to have all three at once: fast compilation, ease of programming, and efficient production execution.<\/p>\n<p>While Go is a versatile programming language that can be used for many different programming projects, it is particularly well-suited for network\/distributed systems applications and is known as the \u201clanguage of the cloud.\u201d It focuses on helping the modern programmer do more with a robust set of tools, eliminates formatting discussions by making formatting part of the language specification, and also simplifies deployment by compiling into a single binary. Go is easy to learn, with a very small set of keywords, making it a great choice for beginners and experienced developers alike.<\/p>\n<p>This tutorial will guide you through installing and configuring a Go programming workspace via the command line. This tutorial explicitly covers the installation steps for Ubuntu 18.04, but the general principles can be applied to other Debian-based Linux distributions.<\/p>\n<h5 id=\"%d9%be%db%8c%d8%b4-%d9%86%db%8c%d8%a7%d8%b2%d9%87%d8%a7\">Prerequisites<\/h5>\n<ul>\n<li>You will need a computer or virtual machine with Ubuntu 18.04 installed, as well as administrative access to that device and an internet connection.<\/li>\n<\/ul>\n<h2 id=\"%d9%85%d8%b1%d8%ad%d9%84%d9%87-1-%d8%b1%d8%a7%d9%87-%d8%a7%d9%86%d8%af%d8%a7%d8%b2%db%8c-go\">Step 1 \u2013 Setting Up Go<\/h2>\n<p>At this point, you will install Go by downloading the current version from the official Go downloads page.<\/p>\n<p>First, connect to the Ubuntu server via ssh:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>ssh sammy@your_server_ip\r\n<\/code><\/pre>\n<\/div>\n<p>Next, go to the official Go downloads page in your web browser. From there, copy the URL for the current binary tarball.<\/p>\n<p>As of this writing, the latest version is go1.16.7. To install Go on an Ubuntu server (or any Linux server), copy the URL of the file ending in linux-amd64.tar.gz.<\/p>\n<p>Now that you have your link ready, first verify that you are in the main directory:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>cd <\/code><\/pre>\n<\/div>\n<p>Then use curl to retrieve the tarball, making sure to replace the highlighted URL with the one you just copied. The -O flag ensures that this output goes to a file, and the L flag instructs HTTPS redirection, as the link is taken from the Go website and is redirected here before downloading the file:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>curl -OL https:\/\/golang.org\/dl\/go1.16.7.linux-amd64.tar.gz\r\n<\/code><\/pre>\n<\/div>\n<p>To verify the authenticity of the file you downloaded, run the sha256sum command, passing it the file name as an argument:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sha256sum go1.16.7.linux-amd64.tar.gz\r\n<\/code><\/pre>\n<\/div>\n<p>This will return the SHA256 checksum of the tarball:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\ngo1.16.7.linux-amd64.tar.gz\r\n7fe7a73f55ba3e2285da36f8b085e5c0159e9564ef5f63ee0ed6b818ade8ef04 go1.16.7.linux-amd64.tar.gz<\/code><\/pre>\n<\/div>\n<p>If the checksum matches what is listed on the Downloads page, you have completed this step correctly.<\/p>\n<p>Next, use tar to extract the tarball. This command includes the -C flag, which tells tar to change to the given directory before performing any other operations. This means that the extracted files will be written to the \/usr\/local\/ directory, the recommended location for installing Go\u2026 The x flag tells tar to extract, v tells it that we want the full output (a list of the files being extracted), and f tells it to specify a filename:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo tar -C \/usr\/local -xvf go1.16.7.linux-amd64.tar.gz\r\n<\/code><\/pre>\n<\/div>\n<p>Although \/usr\/local\/go is the recommended location to install Go, some users may prefer or need different paths.<\/p>\n<h2 id=\"%d9%85%d8%b1%d8%ad%d9%84%d9%87-2-%d8%aa%d9%86%d8%b8%db%8c%d9%85-go-paths\">Step 2 \u2013 Setting Go Paths<\/h2>\n<p>In this step, you determine paths in your environment.<\/p>\n<p>First, set the Go root value, which tells Go where to look for its files. You can do this by editing the .profile file, which contains a list of commands that the system runs every time you log in.<\/p>\n<p>Use your favorite editor to open the .profile file, which is stored in the user&#039;s home directory. We&#039;ll use nano here:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo nano ~\/.profile\r\n<\/code><\/pre>\n<\/div>\n<p>Then add the following information to the end of your file:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>. . .\r\nexport PATH=$PATH:\/usr\/local\/go\/bin<\/code><\/pre>\n<\/div>\n<p>Once you have added this information to your profile, save and close the file. If you are using nano, do this by pressing CTRL+X, then Y, then ENTER.<\/p>\n<p>Then update your profile by running the following command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>source ~\/.profile\r\n<\/code><\/pre>\n<\/div>\n<p>After that, check if you can run go commands by running the go version:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>go version\r\n<\/code><\/pre>\n<\/div>\n<p>This command will output the release number of each version of Go installed on your system:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\ngo version go1.16.7 linux\/amd64<\/code><\/pre>\n<\/div>\n<p>This output confirms that you are now running Go on your server.<\/p>\n<h2 id=\"%d9%85%d8%b1%d8%ad%d9%84%d9%87-3-%d8%a2%d8%b2%d9%85%d8%a7%db%8c%d8%b4-%d9%86%d8%b5%d8%a8\">Step 3 \u2013 Test the installation<\/h2>\n<p>Now that Go is installed and the paths for your server are set up, you can create your Hello, World! application to make sure Go is working.<\/p>\n<p>First, create a new directory for your Go workspace, where Go will build its files:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>mkdir hello\r\n<\/code><\/pre>\n<\/div>\n<p>Then go to the directory you created:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>cd hello\r\n<\/code><\/pre>\n<\/div>\n<p>When importing packages, you need to manage dependencies through the module itself. You can do this by creating a go.mod file with the go mod init command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>go mod init your_domain\/hello\r\n<\/code><\/pre>\n<\/div>\n<p>Next, create a Hello, World! Go file in your favorite text editor:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>nano hello.go\r\n<\/code><\/pre>\n<\/div>\n<p>Add the following text to your hello.go file:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>package main\r\nimport \"fmt\"\r\nfunc main() {\r\nfmt.Println(\"Hello, World!\")\r\n}<\/code><\/pre>\n<\/div>\n<p>Then save and close the file by pressing CTRL+X then Y then ENTER.<\/p>\n<p>Test your code to verify that it prints Hello, World! Greeting:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>go run .\r\n<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\nHello, World!<\/code><\/pre>\n<\/div>\n<p>The go run command compiles and runs the Go package from a list of .go source files in the new hello directory you created and the path you entered. However, you can also use go build to create an executable file, which can save you time.<\/p>\n<h2 id=\"%d9%85%d8%b1%d8%ad%d9%84%d9%87-4-%da%a9%d8%af-go-%d8%ae%d9%88%d8%af-%d8%b1%d8%a7-%d8%a8%d9%87-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%d8%a7%d8%ac%d8%b1%d8%a7%db%8c%db%8c-%d8%a8%d8%a7%db%8c\">Step 4 \u2013 Convert your Go code into a binary executable file<\/h2>\n<p>The go run command is commonly used as a shortcut to compile and run a program that requires frequent changes. In cases where you have finished your code and want to run it without compiling it every time, you can use go build to convert your code into an executable binary. Building your code into an executable binary combines your program into a single file with all the supporting code necessary to run the binary. Once you have built the binary executable, you can run the go install program to place your program in the executable path so that you can run it from anywhere on your system. Then, your program will successfully say Hello, World! when prompted and you will no longer need to compile the program.<\/p>\n<p>Try it out and run go build. Make sure to run this from the same directory where your hello.go file is stored:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>go build\r\n<\/code><\/pre>\n<\/div>\n<p>Then, run .\/hello to verify that the code is working correctly:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>.\/hello\r\n<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\nHello, World!<\/code><\/pre>\n<\/div>\n<p>This confirms that you have successfully converted your hello.go code into an executable binary. However, you can only call this binary from within this directory. If you want to run this program from another location on your server, you will need to specify the full path to the binary file to run it.<\/p>\n<p>Typing out the full path to a binary file can quickly become tedious. Alternatively, you can run the go install command. This is similar to go build but instead of putting the executable in the current directory, go install and place it in the $GOPATH\/bin folder, which allows you to run it from anywhere on your server.<\/p>\n<p>To successfully run go install, you need to pass it the binary installation path that you created with go build. To find the binary installation path, run the following go list command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>go list -f \u2018{{.Target}}\u2019\r\n<\/code><\/pre>\n<\/div>\n<p>go list produces a list of every Go package by name stored in the current working directory. The f flag causes go list to return the output in a different format based on the package pattern you pass it. This tells it to use the Target pattern, which causes go list to return the installation path of every package stored in this directory:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n\u2018\/home\/sammy\/go\/bin\/hello<\/code><\/pre>\n<\/div>\n<p>This is the installation path of the binary file that you created with go build. That is, the directory where this binary is installed is \/home\/sammy\/go\/bin\/.<\/p>\n<p>Add this installation directory to your system shell path. Make sure to change the highlighted part of this command to reflect the binary installation directory on your system, if it is different:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>export PATH=$PATH:\/home\/sammy\/go\/bin\/\r\n<\/code><\/pre>\n<\/div>\n<p>Finally, run go install to compile and install the package:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>go install\r\n<\/code><\/pre>\n<\/div>\n<p>Run this executable binary by just typing hello<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>hello\r\n<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\nHello, World!<\/code><\/pre>\n<\/div>\n<p>If you get Hello, World! output, you have successfully made your Go application executable from a specified and unspecified path on your server.<\/p>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">Result<\/h2>\n<p>By downloading and installing the latest Go package and specifying its paths, you now have a system for Go development. You can find additional articles on installing and using Go in our Go tag and subscribe<\/p>","protected":false},"excerpt":{"rendered":"Introduction Go is a programming language born out of frustration at Google. Developers are\u2026","protected":false},"author":1,"featured_media":16037,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u062f\u0631 Ubuntu","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193,363],"tags":[440,435,368],"class_list":{"0":"post-16036","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"category-programming","9":"tag-go","10":"tag-programming","11":"tag-ubuntu"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04 - \u0628\u0644\u0627\u06af ITPiran<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04 - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 Go \u06cc\u06a9 \u0632\u0628\u0627\u0646 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0646\u0627\u0627\u0645\u06cc\u062f\u06cc \u062f\u0631 \u06af\u0648\u06af\u0644 \u0645\u062a\u0648\u0644\u062f \u0634\u062f\u0647 \u0627\u0633\u062a. \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0646\u062f\u06af\u0627\u0646 \u0628\u0647&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-03T10:44:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2024\/08\/20130657\/go-ubuntu.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04\",\"datePublished\":\"2024-09-03T10:44:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/\"},\"wordCount\":132,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/08\\\/20130657\\\/go-ubuntu.jpg\",\"keywords\":[\"Go\",\"programming\",\"Ubuntu\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/\",\"name\":\"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04 - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/08\\\/20130657\\\/go-ubuntu.jpg\",\"datePublished\":\"2024-09-03T10:44:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/08\\\/20130657\\\/go-ubuntu.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/08\\\/20130657\\\/go-ubuntu.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/en\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Go and Set Up a Local Development Environment on Ubuntu 18.04 - ITPiran Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/","og_locale":"en_US","og_type":"article","og_title":"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04 - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 Go \u06cc\u06a9 \u0632\u0628\u0627\u0646 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0646\u0627\u0627\u0645\u06cc\u062f\u06cc \u062f\u0631 \u06af\u0648\u06af\u0644 \u0645\u062a\u0648\u0644\u062f \u0634\u062f\u0647 \u0627\u0633\u062a. \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0646\u062f\u06af\u0627\u0646 \u0628\u0647&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2024-09-03T10:44:30+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2024\/08\/20130657\/go-ubuntu.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04","datePublished":"2024-09-03T10:44:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/"},"wordCount":132,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/08\/20130657\/go-ubuntu.jpg","keywords":["Go","programming","Ubuntu"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc","\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/","name":"How to Install Go and Set Up a Local Development Environment on Ubuntu 18.04 - ITPiran Blog","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/08\/20130657\/go-ubuntu.jpg","datePublished":"2024-09-03T10:44:30+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2024\/08\/20130657\/go-ubuntu.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2024\/08\/20130657\/go-ubuntu.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-install-go-and-set-up-a-local-programming-environment-on-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u0646\u062d\u0648\u0647 \u0646\u0635\u0628 Go \u0648 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u06cc\u06a9 \u0645\u062d\u06cc\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u062d\u0644\u06cc \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 18.04"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"ITPiran Blog","description":"Iranian Sustainable Trade News and Articles","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"Sustainable Iranian Business Blog","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"admin","url":"https:\/\/www.itpiran.net\/blog\/en\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/16036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/comments?post=16036"}],"version-history":[{"count":24,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/16036\/revisions"}],"predecessor-version":[{"id":16068,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/16036\/revisions\/16068"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/media\/16037"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/media?parent=16036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/categories?post=16036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/tags?post=16036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}