No matter what programming language you learn, there are four steps you will go through at the beginning
- Development tools installation
- IDE installation
- Set dependency / package image
- Project building tools, managing dependencies / packages
1、 Installation of golang development tools
https://golang.org/ Official website (need respective means)
https://github.com/golang/go GitHub address
http://docscn.studygolang.com/ Golang Chinese website
2、 GoLand ide installation
https://www.jetbrains.com/zh-cn/go/
3、 Set dependency / package image
Common image address:
Alibaba cloud:https://mirrors.aliyun.com/goproxy
Microsoft:https://goproxy.io
Qi niuyun:https://goproxy.cn
GoCenter: https://gocenter.io
4、 Project building tools, managing dependencies / packages
Reference article
An introduction to the relationship among root, gopath and go modules
https://www.jb51.net/article/197551.htm
1. In go.mod Chinese Editor
go.mod You can write the following keywords:
- module
Define module path
- go
Define go language version
- require
Specify the dependent suite. The default is the latest version. You can specify the version number
- exclude
Exclude the kit and its version
- replace
Use a different KIT version and replace the original kit version annotation
//Single line annotation
/*Multiline annotation*/
Indirect represents the dependency package that is indirectly imported
2. Command line go get address
As long as it’s opengo modules
Function,go get
It’s not going to be like beforeGOPATH/src
The package file will be placed in theGOPATH/pkg/mod
Inside, andgo.mod
I will write the introduction, so I don’t need to use itgo mod downloa
The D command is out.
summary
Here is the article about how to use Golan ide go mod to build a project. For more information about Golan ide go mod, please search previous articles of developer or continue to browse the following articles. I hope you can support developer more in the future!