[email protected] once said:
> I think the Go tool does cover C programs and even (somebody will
> correct me if I'm wrong, I hope) assembler ones. It would be silly if
> it didn't, or at least hard to use for things like the runtime. One
> of Go's weak spots is that a lot of unconventional behaviour is poorly
> documented. But I'm sure third party documentation will come soon.
This is correct. The go tool supports files with an
extension matching (go|[chsS]|swig(cxx)?|syso).
For .go files, each file is read until the end of the
import declarations.
For everything else (except .syso), each file is read
to determine the build constraints. The rules for these
are explained here
http://golang.org/pkg/go/build/#hdr-Build_Constraints
Files with the extension .syso are not read by the
go tool. They're opaque externally-generated blobs
that are simply added to the archive before linking.
Anthony