go build works fine but go run fails

后端 未结 2 1576
无人及你
无人及你 2020-11-29 08:31

I have a few files in the main package under one directory:

main.go config.go server.go

When I do: \"go build\" the program builds perfect and runs fine. Whe

2条回答
  •  自闭症患者
    2020-11-29 08:57

    This should work

    go run main.go config.go server.go
    

    Go run takes a file or files and it complies those and only those files which explains the missing symbols in the original post.

提交回复
热议问题