當我使用標志包時// main.goimport ( ... "flag" )func main() { ... flag.Parse() switch flag.Arg(0) { case "doSomething1": ... case "doSomething2": ... }}如果 doSomething1 參數為我打印一些錯誤消息,無論我修復源代碼,它都無法刪除舊的錯誤代碼并再次編譯。// command-line# go build ./main.go# ./main doSomething1# error doSomething1 can not work-- I fix my code# ./main doSomething1# error doSomething1 can not work-- the error message also show me again-- I have to delete main and build again# rm ./main# go build ./main.go# ./main.go doSomething1# doSomething1 now can work
go中如何清除執行緩存
慕田峪7331174
2023-07-31 17:07:46