Reputation:
How to know which files are going to be compiled and linked when you have several files which are specific to a system?
Upvotes: 0
Views: 105
Reputation: 7083
There are at least a couple of options:
go build -n
to list the commands that would be executed by a build, and then parse the output.go/build
package. Specifically, look at the Import function.I suggest the second method; if I understand your question correctly it does what you need. You specify a package to "import", and it returns a Package
structure which contains, among other things, the set of Go, C, ASM files that will be compiled.
Upvotes: 2