1. If the go.mod file is not automatically generated in the microservice package under the service package, run the following command to generate the go.mod file
go mod init
Copy the code
  1. Download all dependencies

Select an error and click sync… If not, try:

go get ./
Copy the code
  1. Enabling the go modules integration

Preferences > GO > GO Modules

  1. Go Modules may cause import problems in web packages.

    • Create the go.mod file
    go mod init test_go_mod
    Copy the code
    • Re-download the installation package (or click sync…
    go get -u github.com/gin-gonic/gin
    Copy the code
    • Change the path of your own package

    The previous path is bj38web/web/utils, which is not recognized at this time

    Need to change toThe mod name/utils, such astest_go_mod/utils