3 ms·
Please don't follow this suggestion. It's very helpful and healthy to have everything in a single file if you consider that manageable, so no problem at all.
by fiatjaf 9y ago
Please don't follow this suggestion. It's very helpful and healthy to have everything in a single file if you consider that manageable, so no problem at all.
- JepZ 9y agoWell, 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.
- gschier 9y agoYes, this looks like very common Go code. No need to increase complexity by breaking it up.
- Xeoncross 9y agoIt would be one thing if he just wanted a single go file for one reason, but the repo already contains multiple files. I'm recommending he break up the main file according to concerns. (common in go)