Comments (6)
@sahitpj If that's the most used way of organizing code, then let's go with that.
from eyes.
@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.
-
Put everything in the
main
package, and have each.go
file placed in the same directory asmain.go
. For example,ls eyes/ # => whois.go main.go etc...
, all being part of themain
package. -
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 thewhois
package.
Is this what you meant? Thoughts?
from eyes.
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
from eyes.
@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'?
from eyes.
@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
from eyes.
Gonna' close this. Seems like we figured it out.
from eyes.
Related Issues (11)
- Move from APIs to native features implementation? HOT 6
- Logo? HOT 2
- Looking for contributor(s) HOT 7
- Using CI HOT 6
- Contributors, please specify which OS you are hacking onto eyes with HOT 3
- Using Go Build to execute HOT 6
- Adding Magefile HOT 1
- Making an Organization
- os.Exit(0) exits with 1 inside goroutine HOT 1
- Return `err.Error()'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eyes.