Closed sahitpj closed 5 years ago
@sahitpj Could you elaborate a bit more on this?
If you're talking about structure of the source code, I envision two ways we can do this.
1) Put everything in the main
package, and have each .go
file placed in the same directory as main.go
. For example, ls eyes/ # => whois.go main.go etc...
, all being part of the main
package.
2) In the root directory of the project, create subdirectories for each package (which will keep all the code for making a particular feature work). In those subdirectories, there will be only one package. In example, whois/whois.go
is from the whois
package.
Is this what you meant? Thoughts?
I was actually thinking of 3) a src/pkg directory -> subdirectory of packages -> will contain their own modules
But I think option 2 should do it
@sahitpj You know, option 3 doesn't sound so bad. I've been meaning to read up on Go best practices, specifically regarding source code structure. Do you have a clue on what the 'mainstream' practice is, or is it still very 'Wild West'?
@naltun Most go projects that I have seen have a pkg directory, a tests directory, and other components
Within the pkg directory they have sub directories for each pkg and within that, they have their files. That's the general practice
@sahitpj If that's the most used way of organizing code, then let's go with that.
Gonna' close this. Seems like we figured it out.
Hey @naltun, since we were redesigning this module, I was wondering how the structure would be: