Get Started
The version
package was built to remove the repetitiveness in implementing the version command.
As such, it was designed in the form of building blocks, which you can mix and match based on your needs, and integrate with different frameworks.
For example:
- Use the upgrade notice component. The usage is not limited to the CLI only. You can embed this into all of your binaries.
- Use
version
's coreinfo
object with data collected automatically viaversion.Get()
. - Use
version
's core printer component withversion.Get()
or with theInfo
object that you filled yourself. - Set up Cobra's
version
command with the default printer and an enabled upgrade notice as shown in the quick-start.
To get inspired, see also other examples.
Each component can be customized. See the customization documentation to learn more.