How to compile Go program consisting of multiple files?

前端 未结 7 1041
野的像风
野的像风 2020-12-04 09:15

I have a small program that consists of three files, all belonging to the same package (main), but when I do \"go build main.go\" the build doesn\'t succeed. When it was jus

7条回答
  •  不思量自难忘°
    2020-12-04 09:50

    You could also just run

    go build
    

    in your project folder myproject/go/src/myprog

    Then you can just type

    ./myprog
    

    to run your app

提交回复
热议问题