Go文件右鍵編譯

辛辛苦苦寫好了.go文件 發現編譯還得敲命令才行,或許配置一個好用點的IDE環境能夠解決shell

可是有時候實在不想開IDE 因而在右鍵添加了一個編譯功能ui

首先保證go相關的環境變量配置正確spa

1 Windows Registry Editor Version 5.00
2 
3 [HKEY_CLASSES_ROOT\*\shell\Build With Go\command]
4 @="cmd.exe /k \"go build %1 && echo ok\""

而後保存代碼到reg文件 而後執行 合併到註冊表code

這樣全部文件的右鍵將會多出一個 go build 菜單命令blog

單獨給go文件增長的菜單cmd

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\go_auto_file\shell\Build With Go ]

[HKEY_CLASSES_ROOT\go_auto_file\shell\Build With Go \command]
@="cmd.exe /k \"go build %1 && echo ok\""

[HKEY_CLASSES_ROOT\go_auto_file\shell\Build With Go \ddeexec]
相關文章
相關標籤/搜索