Coder Social home page Coder Social logo

[RFC] improve generated boilerplate about cobra-cli HOT 8 OPEN

spf13 avatar spf13 commented on August 15, 2024 8
[RFC] improve generated boilerplate

from cobra-cli.

Comments (8)

enrichman avatar enrichman commented on August 15, 2024 1

I've found this issue and RFC because I was going to open an issue/question about the init() func, and if it was possible to change the docs and user guide, and probably the generator (I've not used it, but I guess that it's going to generate the everything "globally".

I've found a really nice article on how to structure a Cobra application, and this is what I am using as a guidance at the moment: https://carolynvanslyck.com/blog/2020/08/sting-of-the-viper/

Is this RFC going to be implemented? Or what's the state of it? 🙂

from cobra-cli.

johnSchnake avatar johnSchnake commented on August 15, 2024

spf13/cobra#1290 was also an issue pointing out that data races were detected in that default app. This will be something we need to check when we re-write the sample.

from cobra-cli.

jxsl13 avatar jxsl13 commented on August 15, 2024

#14 is a step forward.

  • I usually do call rootCmd.AddCommand(NewSubCommand()) inside of the constructor NewRootCmd() which would be quite hard to do with generated code. cobra-cli would need to actually parse generated Go code and append lines at specific locations for that to work with sub commands that are added afterwards.

from cobra-cli.

github-actions avatar github-actions commented on August 15, 2024

This issue is being marked as stale due to a long period of inactivity

from cobra-cli.

github-actions avatar github-actions commented on August 15, 2024

This issue is being marked as stale due to a long period of inactivity

from cobra-cli.

github-actions avatar github-actions commented on August 15, 2024

This issue is being marked as stale due to a long period of inactivity

from cobra-cli.

github-actions avatar github-actions commented on August 15, 2024

This issue is being marked as stale due to a long period of inactivity

from cobra-cli.

github-actions avatar github-actions commented on August 15, 2024

This issue is being marked as stale due to a long period of inactivity

from cobra-cli.

Related Issues (20)

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.