3 ms·
Well, in Go all files in one directory are part of one package (best practice) and files within the same package do not have to import each other to have access
by JepZ 9y ago
Well, in Go all files in one directory are part of one package (best practice) and files within the same package do not have to import each other to have access to other functions. Therefore, breaking the package into several files is common practice.
A sane approach to this is for example to create a separate file for each type (Collector, HTMlElement, Request, Response, ...) and its attached functions/methods.