Go install doesn't create any bin file

前端 未结 3 1416
感情败类
感情败类 2021-02-03 22:37

My folder structure is correct, i can both run go install from inside the package folder and from anywhere in the system, adding the package (folder) name after

3条回答
  •  情深已故
    2021-02-03 22:48

    One reason could be the file.go isn't in package main.
    See for instance "Your first program"

    If it was, that would generate a executable in bin.

    The article "How does the go build command work ?" does mention:

    A Go command is a package who’s name is main.
    Main packages, or commands, are compiled just like other packages, but then undergo several additional steps to be linked into final executable.

提交回复
热议问题