5 ms·
Off-topic: any reason why so many Go repositories have a flat structure? Wouldn't it be nicer to organize all the *.go files?
by andreygrehov 9y ago
Off-topic: any reason why so many Go repositories have a flat structure? Wouldn't it be nicer to organize all the *.go files?
- jadeklerk 9y agoImport paths are nicer with a flat structure. E.g. the difference between import "github.com/whomever/orm" and import "github.com/whomever/orm/fiz/bang/whiz/resolvers".
- deleted 9y ago[deleted]
- jbboehr 9y agoPart of is is probably because subfolders are subpackages and relative imports don't work and absolute imports have other issues - like causing issues with forking.
- littlestymaar 9y ago> because subfolders are subpackages and relative imports don't work Really ? Is that a bug, or by design ? If the later, what's the rationnal about it ?
- jbboehr 9y agoIIRC the tooling is not smart enough to resolve them when you import a subpackage directly. I was working on a go project and I had to convert all of the relative imports to absolute imports for some reason, but the exact cause escapes my memory.