哈伯,你好!我们在两周前发布了GoLand 2020.2,并希望向您介绍此版本的主要变化。
简而言之,我们改进了对Go模块的支持,使查找代码中的可能问题和弱点变得更加容易,并添加了新的代码检查。
, , , Go Playground, , WSL 2 Git Windows, !
, IDE. What's New in GoLand 2020.2 .
Go modules
Go 1.15 $GOPATH/pkg/mod
, GOMODCACHE.
GOMODCACHE Preferences/Settings | Go Modules | Environment. IDE .
go.mod Comment With Line Comment (Ctrl+/ Windows/Linux ⌘/ macOS).
IDE Navigate to Declaration or Usages (⌘B macOS Ctrl+B/ Windows/Linux).
Inspections Widget , . Next Error (F2).
( , ), Compact View, .
Problems Alt+Enter.
Problems, Inspections Widget View | Tool Window | Problems. , .
string(int)
, UTF-8 Unicode x
x
.
GoLand .
GoLand — go vet. IDE (quick-fix). , GoLand Testme TestMe.
Malformed struct tag , , .
Impossible interface type assertion v.(T), switch, , V v , T. , V T , .
, Show Context Actions Alt+Enter, ⌥+Space macOS Ctrl+Shift+I Windows Linux.
Add Caret Per Selected Line . Alt+Shift+G Windows/Linux ⌥⇧G macOS.
, Preferences/Settings | Editor | Code Style | Go | Wrapping and Braces.
Put arguments on separate lines Put arguments on one line Alt+Enter, .
Introduce Variable (Ctrl+Alt+V Windows Linux, ⌘⌥ V macOS) , Inline Variable (⌥⌘N macOS Ctrl+Alt+N Linux Windows), , .
Unpack slice .
, . Tools | Save Project as Template. IDE , .
Go Playground
Go Playground, . Go Tools | Share in Playground Tools | Go Tools | Share in Playground, ⌥⇧⌘S macOS Ctrl+Alt+Shift+S Windows/Linux.
Playground go2
-, GoLand https://go2goplay.golang.org/.
GoLand 2020.2 . Enable experimental support for generics a.k.a type parameters Settings/Preferences | Go.
go2-.
IDE
Vendoring mode , , , vendor .
, Vendor Enable vendoring mode automatically Settings/Preferences | Go | Go Modules, GoLand vendor .
GoLand 2020.2 go list
.
WSL 2 Git Windows
GoLand 2020.2 Git WSL 2, Windows 10, 2004. Git Windows, GoLand Git WSL . IDE Git WSL , WSL ( \wsl$ path
).
Git
Merge, Pull Rebase Git, . , . –rebase Pull –no-verify Merge.
- GitHub
- GitHub. , -, , , , GoLand.
Compare branches
, GoLand, . IDE VCS, .
, IntelliJ IDEA Ultimate, GoLand , Go.
!