In replace directives, the IDE would not download or delete missed dependencies, and the lines with these unused dependencies would be marked red. Sync dependencies: fetches and downloads missed dependencies and removes unused ones by calling go mod tidy/vendor. You can select between the following options: Press Alt+Enter and select action that you want to perform. In the Project tool window ( View | Tool Windows | Project), double-click the MOD file. For more information about enabling Go modules integration, refer to Enable Go in a project. When a new project is opened in the IDE, the Download Go module dependencies setting will default to Enable for all projects for it.Įnsure that Go modules integration is enabled. When a new project is opened in the IDE, the Download Go module dependencies setting will default to Disable for all projects for it.ĭisable for current project, enable for other projects: turns off automatic download of Go dependencies only for the current project. Disable this option if you have a limited internet connection or need to download dependencies only of certain Go modules.ĭisable for all projects: turns off automatic download of Go dependencies for all projects that you open.Įnable for current project, disable for other projects: activates automatic download of Go dependencies only for the current project. The IDE runs 'go mod download' automatically after each execution of 'go list -m'. You can select between the following options:Įnable for all projects: activates automatic download of Go dependencies for all projects that you open. Open settings by pressing Control+Alt+S and navigate to Go | Go Modules.Ĭlick the Download Go module dependencies drop-down list and select the necessary option. Disable automatic download of Go module dependencies You can configure this behavior in settings. Select the Enable Go modules integration checkbox.īy default, GoLand downloads all the necessary dependencies when you open a project or modify go.mod. Press Control+Alt+S to open the IDE settings and then select Go | Go Modules. If you pulled your Go modules project from Github, you need to enable Go modules manually. If you create a new Go modules project in the IDE, Go modules are already enabled. The version of each Go Module is shown in a dimmed font color to help you distinguish between them. In the Project tool window ( View | Tool Windows | Project), Go modules are displayed with their full import path. Read more about environment variables in the Environment variables section. For example, the GOPROXY environment variable. (Optional) In the Environment field, specify environment variables that you need for your project. (Optional) Select or clear the Enable vendoring support automatically checkbox. To change or install a new version of Go SDK, click the Add SDK… button and select Local… to choose the Go SDK version on your hard drive, or select Download… to download Go SDK from the official repository. Usually, the location is defined automatically. In the GOROOT field, specify the location of your Go installation. In the New Project dialog, select Go from the list of available projects. Create a project with Go modules integrationĪlternatively, click New Project in the Welcome to GoLand dialog. With Go modules, you do not need to keep your project files under GOPATH and can easily manage dependencies in your project. By default, GoLand suggests creating a Go modules project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |