You must prefix the imported types or variables with the name that you pointed to the package in the import (here you use the default name, that is, "time"). This is what you did for the Now function, but you should do it also for types.
Thus, the type is not time , but time.Time (that is, the type of time that is declared in the package you import with the name "time" ).
Change your function to
func printT(t time.Time) time.Time { return t.Add(100) }
And for your second question: No, the import statement does not include the library for the entire program, but only for the current file.
Denys seguret
source share