The development tools

He that will do his work well must first sharpen his tools

IDE, Vscode, Sublime… Many editors have extensions for Go, download them yourself…

I chose the official editor GoLand, which can also be downloaded by myself. The official website address is recommended to choose a new one

With that in mind, let’s start Hello World

Select project directory

To create a custom directory, I chose D:\GoProject as the Go project directory

Hello World

Create a file

  • The editor opened the project and created the HelloWorld. go file as shown in the picture. The editor reminded us that GoROOT is incorrect

  • Configure GOROOT as shown, where the path is [Learn Go (一) Download and install (juejin. Cn)] (Juejin. Cn/post / 699212…) The installation path

  • Set global GOROOT/project GOROOT just needs to be added, and the path is still the one above

  • You can also manually set, open the Settings, add their own working path can be!

Write file

  • The file content

    package main
    
    import "fmt"
    
    func main() {
       fmt.Println("Hello World")
    }
    Copy the code

Run the file

  • You can see the results in the IDE

conclusion

  • This chapter shows you how to select a development tool, how to configure GOROOT, and how to run Hello World

  • This is just the beginning, it’s a prologue. What comes next is important, basic syntax, containers… More slowly!

  • The lane is blocked and long, come on!!