Giter Club home page Giter Club logo

Comments (6)

naltun avatar naltun commented on August 27, 2024 1

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

from eyes.

naltun avatar naltun commented on August 27, 2024

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

from eyes.

sahitpj avatar sahitpj commented on August 27, 2024

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.

naltun avatar naltun commented on August 27, 2024

@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.

sahitpj avatar sahitpj commented on August 27, 2024

@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.

naltun avatar naltun commented on August 27, 2024

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

from eyes.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.