Say I have got code for a project spread across multiple files. Is there any other way to reference such code within files in the project without going through the whole build and install process? For example within a single project, I might have an implementation of a type Foo in file A and I might want to use such type in file B within the same project. Is there anyway to go about doing that
Share
It’s not clear to me what exactly you’re asking about, but this part of the language specs about “Declarations and scope” might be related and/or helpful. Another, more prosaic source of related information might probably be “How to Write Go Code”.
EDIT – Expanding on now expanded question:
If “package a” declares type
Foo– then, b/cFoostarts with an upper case letter –Foois exported bya. Then in “package b” one would writeimport "a"and can then refer to that type asa.Fooinside “package b”.