Linux supports go language because go language can be cross-platform. Due to its modular design and modularity, that is, the code is compiled and converted into the smallest possible binary form, therefore, the Go language does not require dependencies and supports platform independence; its code can be run on any platform (Windows, Linux, Mac OS etc.) and can be compiled on any server and application.
Go is a procedural programming language that can be used for fast machine code compilation. It is a statically typed compiled language. It provides a concurrency mechanism that makes it easy to develop multi-core and networked machine-level programs. It is a fast, dynamically typed and interpreted language; it provides support for interfaces and type embedding.
Linux supports go language because go language can be cross-platform.
Go language, like Java language, supports platform independence. It requires no dependencies due to its modular design and the compilation and conversion of code into a minimized binary form. Its code can be compiled on any platform (Windows, Linux, Mac OS, etc.) and can be compiled on any server and application.
Go language code can be directly compiled into binary executable files without using a virtual machine. The Go language has an independent linker and does not need to rely on the compiler and linker provided by any operating system. Therefore, the compiled binary executable file can run in almost any system environment.
Building a Go language development environment on Linux
1. Install the Go language development package
You can view it on the Go language official website Looking at the installation package, the development package has two versions: 32-bit and 64-bit. You need to choose different versions according to the situation of the reader's computer.

Copy the download link of the Go language development package. Then, use the cd command in the terminal to enter the directory where you store the installation package (the /usr/local/ directory is used here, readers can also use other directories).
root@ububtu:~# cd /usr/local/ root@ububtu:/usr/local#
Use the wget command to download the Go language development package, as shown below.
<pre class='brush:php;toolbar:false;'>root@ububtu:/usr/local# wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
--2019-11-06 10:47:23-- https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
正在解析主机 dl.google.com (dl.google.com)... 203.208.39.196, 203.208.39.193, 203.208.39.200, ...
正在连接 dl.google.com (dl.google.com)|203.208.39.196|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 120054682 (114M) [application/octet-stream]
正在保存至: “go1.13.4.linux-amd64.tar.gz”
go1.13.4.linux 43% 49.44M 3.56MB/s 剩余 16s ^go1.13.4.linux 100% 114.49M 4.73MB/s 用时 31s
2019-11-06 10:47:56 (3.67 MB/s) - 已保存 “go1.13.4.linux-amd64.tar.gz” [120054682/120054682])</pre><p>Use the tar command to decompress the Go language development package you just downloaded.
</p><pre class='brush:php;toolbar:false;'>root@ububtu:/usr/local# tar -C /usr/local -xzf go1.13.4.linux-amd64.tar.gz</pre><p>After successful decompression, a go directory will be added in the current directory. At this point, our Go language development kit has been installed. Use the cd command to enter the directory, and then execute bin/ You can use the go version command to view the current Go language version.
</p><pre class='brush:php;toolbar:false;'>root@ububtu:/usr/local/go# bin/go version
go version go1.13.4 linux/amd64</pre><p><strong>Configure environment variables</strong></p>
<p>We need to configure 2 environment variables, GOROOT and PATH. </p>
<ul class=" list-paddingleft-2">
<li><p>The value of GOROOT should be the current installation directory of the Go language: <code>export GOROOT=/usr/local/go
PATH In order to facilitate the use of Go language commands and Go program executable files, you need to append its value: export PATH=$PATH:$GOROOT/bin:$GOBIN
In order to facilitate future use, these environment variables need to be added to the profile file (~/.bash_profile or /etc/profile). If it is used by a single user, the environment variable can be added to the bash_profile file in the home directory. If used by multiple users, it needs to be added to the /etc/profile file. It is recommended to set environment variables in the /etc/profile file
Use the vi /etc/profile command to open the profile file and add the environment variables to the end of the file.

After the addition is completed, use the :wq command to save and exit.
Then, use the source /etc/profile command to make the configuration file take effect. Now you can use Go language commands in any directory.
Verify installation
Use the terminal in any directory to execute the go env command. The following output shows that the Go language development package has been successfully installed.
<pre class='brush:php;toolbar:false;'>root@ububtu:~$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/feng/.cache/go-build"
GOENV="/home/feng/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/feng/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
. . .</pre><p> Tip: Only partial results are shown above. <br></p>
The above is the detailed content of Linux does not support go language. For more information, please follow other related articles on the PHP Chinese website!
Linux Operations: System Administration and MaintenanceApr 15, 2025 am 12:10 AMThe key steps in Linux system management and maintenance include: 1) Master the basic knowledge, such as file system structure and user management; 2) Carry out system monitoring and resource management, use top, htop and other tools; 3) Use system logs to troubleshoot, use journalctl and other tools; 4) Write automated scripts and task scheduling, use cron tools; 5) implement security management and protection, configure firewalls through iptables; 6) Carry out performance optimization and best practices, adjust kernel parameters and develop good habits.
Understanding Linux's Maintenance Mode: The EssentialsApr 14, 2025 am 12:04 AMLinux maintenance mode is entered by adding init=/bin/bash or single parameters at startup. 1. Enter maintenance mode: Edit the GRUB menu and add startup parameters. 2. Remount the file system to read and write mode: mount-oremount,rw/. 3. Repair the file system: Use the fsck command, such as fsck/dev/sda1. 4. Back up the data and operate with caution to avoid data loss.
How Debian improves Hadoop data processing speedApr 13, 2025 am 11:54 AMThis article discusses how to improve Hadoop data processing efficiency on Debian systems. Optimization strategies cover hardware upgrades, operating system parameter adjustments, Hadoop configuration modifications, and the use of efficient algorithms and tools. 1. Hardware resource strengthening ensures that all nodes have consistent hardware configurations, especially paying attention to CPU, memory and network equipment performance. Choosing high-performance hardware components is essential to improve overall processing speed. 2. Operating system tunes file descriptors and network connections: Modify the /etc/security/limits.conf file to increase the upper limit of file descriptors and network connections allowed to be opened at the same time by the system. JVM parameter adjustment: Adjust in hadoop-env.sh file
How to learn Debian syslogApr 13, 2025 am 11:51 AMThis guide will guide you to learn how to use Syslog in Debian systems. Syslog is a key service in Linux systems for logging system and application log messages. It helps administrators monitor and analyze system activity to quickly identify and resolve problems. 1. Basic knowledge of Syslog The core functions of Syslog include: centrally collecting and managing log messages; supporting multiple log output formats and target locations (such as files or networks); providing real-time log viewing and filtering functions. 2. Install and configure Syslog (using Rsyslog) The Debian system uses Rsyslog by default. You can install it with the following command: sudoaptupdatesud
How to choose Hadoop version in DebianApr 13, 2025 am 11:48 AMWhen choosing a Hadoop version suitable for Debian system, the following key factors need to be considered: 1. Stability and long-term support: For users who pursue stability and security, it is recommended to choose a Debian stable version, such as Debian11 (Bullseye). This version has been fully tested and has a support cycle of up to five years, which can ensure the stable operation of the system. 2. Package update speed: If you need to use the latest Hadoop features and features, you can consider Debian's unstable version (Sid). However, it should be noted that unstable versions may have compatibility issues and stability risks. 3. Community support and resources: Debian has huge community support, which can provide rich documentation and
TigerVNC share file method on DebianApr 13, 2025 am 11:45 AMThis article describes how to use TigerVNC to share files on Debian systems. You need to install the TigerVNC server first and then configure it. 1. Install the TigerVNC server and open the terminal. Update the software package list: sudoaptupdate to install TigerVNC server: sudoaptinstalltigervnc-standalone-servertigervnc-common 2. Configure TigerVNC server to set VNC server password: vncpasswd Start VNC server: vncserver:1-localhostno
Debian mail server firewall configuration tipsApr 13, 2025 am 11:42 AMConfiguring a Debian mail server's firewall is an important step in ensuring server security. The following are several commonly used firewall configuration methods, including the use of iptables and firewalld. Use iptables to configure firewall to install iptables (if not already installed): sudoapt-getupdatesudoapt-getinstalliptablesView current iptables rules: sudoiptables-L configuration
Debian mail server SSL certificate installation methodApr 13, 2025 am 11:39 AMThe steps to install an SSL certificate on the Debian mail server are as follows: 1. Install the OpenSSL toolkit First, make sure that the OpenSSL toolkit is already installed on your system. If not installed, you can use the following command to install: sudoapt-getupdatesudoapt-getinstallopenssl2. Generate private key and certificate request Next, use OpenSSL to generate a 2048-bit RSA private key and a certificate request (CSR): openss


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version






