naltun / eyes

👀 🖥️ Golang rewrite of eyes.sh. Let's you perform domain/IP address information gathering. Wasn't it esr who said "With enough eyeballs, all your IP info are belong to us?" 🔍 🕵️
GNU General Public License v2.0
51 stars 8 forks source link

Structure of the module #7

Closed sahitpj closed 5 years ago

sahitpj commented 5 years ago

Hey @naltun, since we were redesigning this module, I was wondering how the structure would be:

naltun commented 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?

sahitpj commented 5 years ago

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

naltun commented 5 years ago

@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'?

sahitpj commented 5 years ago

@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

naltun commented 5 years ago

@sahitpj If that's the most used way of organizing code, then let's go with that.

naltun commented 5 years ago

Gonna' close this. Seems like we figured it out.