On Mon, Feb 3, 2020 at 11:40 AM joe mcguckin
<joseph.p.mcguc...@gmail.com> wrote:
>
> Do all the files listed in the 'import' statement get pulled in and compiled, 
> or merely scanned to resolve function references etc.
>
> As someone who grew up on 'C', it seems a bit weird to not have an 'include' 
> mechanism and its headers.
>
> Does the it matter what order the files appear in the import clause?

Think of a Go package as a .c file automatically defines a .h file
containing declarations of all the names exported by the package.
When you import the package, the compiler reads the implicitly
generated .h file, the Go tool ensures that the equivalent of the .c
file is compiled, and the linker arranges to link in the equivalent of
the .o file.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcX-%3DkXCi6RXMzTmw33pOogO0R3mGSTSEeLt_Kzy-Fwp%2Bg%40mail.gmail.com.

Reply via email to