In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about the configuration of the Go environment in Linux and what are the common operations of GoModule. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Why should I learn go?
Today is the era of mobile and cloud computing, Go appears at a time of industrial transition to cloud computing, simple, efficient, built-in concurrency primitives and modern standard libraries make Go language particularly suitable for cloud software development (after all, it is designed for this). By 2014, the Go project has hundreds of core contributors, countless third-party libraries and tools (https://godoc.org/) in its ecosystem, and many large companies have started or migrated to the go language. Some heavyweight open source cloud projects, such as Docker and Kubernetes, are implemented in the GE language, and some companies that operate the infrastructure Google, CloudFlare, Canonical, Digital Ocean, Github, Heroku and Microsoft are also developing heavyweight projects in the GE language. Let's take a look at the following companies' open source go libraries.
(1) Facebook open source its go library https://github.com/facebookgo
(2) Dropbox opened up its Go-based tool library godropbox, and said that a year ago it had decided to migrate the high-performance back-end programs in Dropbox from Python to the Goe language. Almost all the code of Dropbox is written in Python, and Python language is widely used in server side, desktop client side, website control logic and back-end API and analysis. Dropbox prefers the characteristics of Python, such as easy to learn and high development efficiency, but now in order to support the growing number of users, Dropbox has to replace some services with higher performance requirements with Goto language with better concurrency support and faster running speed.
Go has evolved to version 1.4. In addition to its new features and bug fixes, it lays the foundation for the implementation of a new low-latency garbage collector and support for running Go on mobile terminals. As programmers, we must broaden our horizons and learn the design ideas and quintessence of another language while mastering one language, and I think go is perfect! 2015 will be the year of the Go language explosion.
Go environment configuration and GoModule
Linux correlation
Common operations of Linux
Mkdir directory-create folder vi file-create file, then close vimrm file-delete file rm-rf directory-delete folder recursively, r stands for recursion F force mv A B with package-- move folder, which can be used to rename mv-rf-- cp fromPath toPath-- copy as above, or add-rfrename-- rename Need to install package ls/ll/tree-list folder cat-print file content cd path-enter path sudo apt Install package-Ubuntu installation
Common operations of vim
: W-- write: Q-- exit: wq-- Save exit home/end-- first line bit G/gg -- the end of the article Start with pageup/pagedown-- turn the page backspace/delete-- delete before, then delete dd/yy-- delete and copy the same ndd/nyy-- n and replace it with a number Multi-line pthumb P-paste the cursor down Paste u/ctrl+u/ctrl+r up the cursor-- undo: / word-- search down with the cursor:? word-- search up with the cursor: 1. 1 can be omitted: 1 $s/word1/word2/gc-replacement to be confirmed I-enter input mode ESC-exit input mode ctrl+q-jam forced exit input Mode insert-toggle insert or replace input golang environment configuration
1. Download the go package on the official website-drag it into linux
two。 Decompression
Sudo tar-C / usr/local-zxvf go1.11.5.linux-amd64.tar.gz
3. Configure environment variables
Vim / .bashrc
Add:
# Source package export GOROOT=/usr/local/go# user work path export GOPATH=$HOME/gopath# system environment variable export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
Source / .bashrc
Whether go verison-- successfully exported the go version
GoModule
Create a project folder anywhere
Open the terminal and enter: go mod init + package name
Go.mod and go.sum folders will be generated under the folder.
)
Go.mod records the version of go and the version of dependent package
Go.sum removes hash records for dependency packages as a whole, and also removes hash records from multiple go.mod.
Ensure that the version of the package referenced when multiple people cooperate is the same.
According to the dependency in go.mod, you can download the same version dependency package through go get.
Life is too short for so much sorrow.
Thank you for reading! This is the end of this article on "what is the configuration of the Go environment in Linux and what are the common operations of GoModule?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.