All the files get downloaded to your $GOPATH/src or $GOPATH/pkg, depending
on whether modules are enabled.

Everything gets compiled together into the same static executable, so yes,
the files get compiled.

The order of imports should not matter in well written code, but you can
always create scenarios where importing something tweaks global state, give
this a read:
https://golang.org/ref/spec#Program_execution

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?
>
> Thanks,
>
> joe
>
> --
> 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/6c63ed3c-a8d8-4b40-879b-725c1a440635%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/6c63ed3c-a8d8-4b40-879b-725c1a440635%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CA%2Bv29LuG3wmcbdwJeWDMQHn_KpvHfS_8L74jaTC4iTKiyWpXvg%40mail.gmail.com.

Reply via email to