How to run all .go files within current directory through the command line (multi file package)

前端 未结 11 2514
滥情空心
滥情空心 2020-12-08 01:49

I\'m a newcomer to Go. I extremely like the language, but I quickly realised that I needed to start dividing my files due to an increase in program size.

go r

11条回答
  •  囚心锁ツ
    2020-12-08 02:36

    On Windows I usually just add a little test.bat to all my project directories:

    go build
    .\{project_name}.exe
    go clean
    

    Works well enough. Replace {project_name} with the name of your executable, of course. And once the executable finishes, the batch script moves on to the clean up.

提交回复
热议问题