Win10 install go environment + goland

1. Go language related

① Configuration of go language environment
  1. GOPATHA directory created by myself:, D:\GOPATHand three subdirectories of src, bin and pkg were created in this directory
    Insert picture description here
  2. GOROOTWhen installing, choose:D:\GO
  3. The bin directory with GOROOTand written in the path GOPATH: %GOPATH%\bin, %GOROOT%\bin.
  • Open the command prompt and enter the following command to verify whether the go environment installation is successful
  1. By go versioncommand
    Insert picture description here
  2. By go envcommand:
    Insert picture description here
② Use goland for go language development
  • Download goland from the official website: https://www.jetbrains.com/go/
  • Download speed is super slow, Baidu cloud disk sharing: https://pan.baidu.com/s/1-QrLhWMLiIaIB7H8L9rvrg , extraction code:ipyd
  • Follow the installation instructions, keep next, and then use the student mailbox for free
  • Create a new go project and find that it has been automatically placed in GOPATHthe src directory, but it needs to be configured GOROOT. Click the plus sign --> select local --> select the go installation directory, and add it!
    Insert picture description here
③ Create a simple go project
  • Create a new go file, pay attention to selection simple application, the created go file can be run
    Insert picture description here
    Insert picture description here
  • Enter the following:
package main

import "fmt"

func main() {
    
    
	fmt.Println("hello windows go!")
}
  • The running result is shown in the figure below:
    Insert picture description here

Guess you like

Origin blog.csdn.net/u014454538/article/details/103584937