The most important news about the update is the support for dep, the official experimental dependency management tool. The update is capable of importing existing dep projects and also provides a project wizard for creating new dep projects.
To create a new dep project, open the Project Wizard and switch to the Dep tab on the left-hand side of the dialog:
To create or work with a dep project, you have to fill the Dep location with the path to the dep binary.
If you import an existing dep project, the IDE will detect dep and will prompt you to enable the dep integration:
Now when you work with a dep project and open a file that has an unresolved import statement, the IDE will offer a quick-fix that runs dep ensure:
After you click it, the IDE will run the command and afterward automatically sync the changes in the vendor folder.
The path to the dep location can always be changed in Settings | Go | Dep:
The auto-import mechanism has been made smarter with this update and it now only applies it if the resulting code compiles with no errors (GO-1730). If the resulting code cannot apply without errors, the IDE prompts a quick-fix that adds the corresponding import statement – so you can call it manually.
Code completion suggestions for boolean expressions now can be selected and negated by simply pressing “!” (GO-5411):
A scratch file, created from a Go code selection, now gets all proper import statements automatically. If you haven’t used Scratch Files yet, make sure to try them as they offer a “Go Playground”-like editing session with full IDE support.
The two other minor yet very important improvements are:
- The global symbols now can be renamed and searched for usages much faster.
- The inspection that reports type mismatch now respects type aliases (GO-5190 and GO-5408).
Last but not least, GoLand 2018.1 now offers a brand new plugin for Kubernetes.
To learn more about the plugin, read its announcement in IntelliJ IDEA’s blog.