Documentation
¶
Index ¶
- func AddCommandBuilders(fns ...func() *cobra.Command)
- func AddCommands(cmds ...*cobra.Command)
- func AppName() string
- func CheckCanCustomize()
- func CheckLockedDown()
- func Commands() []*cobra.Command
- func SetAppName(name string)
- func TestMain(m interface{ ... })
- func Version() string
- func VersionInfo() versionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommandBuilders ¶
func AddCommands ¶
func AppName ¶
func AppName() string
AppName is what the app will call itself. When customizing, overwrite it before calling Main().
func CheckCanCustomize ¶ added in v0.5.0
func CheckCanCustomize()
CheckCanCustomize panics if customizations have been locked down at this point in the app startup process.
Use this as a guard / assertion in functions that try to change customizations to ensure they are not called from the wrong place where they may be ineffectual or cause errors.
func CheckLockedDown ¶ added in v0.5.0
func CheckLockedDown()
CheckLockedDown panics if customizations have not been locked down at this point in the app startup process.
Use this as a guard / assertion in functions that put customizations into effect to ensure that they are not called from places where customizations may be modified later and thus break or prevent those future modifications.
func Commands ¶
Commands gets a list of additional commands to add to the fastcat.org/go/gdev/cmd/Root command during app startup.
This will panic if called during the customization phase before the main app startup.
To add custom commands, use AddCommandBuilders or AddCommands
func SetAppName ¶
func SetAppName(name string)
func TestMain ¶ added in v0.12.0
func TestMain(m interface{ Run() int })
TestMain is an implementation you can use for your own TestMain, to get the app initialized before running the tests.
Use this if you're struggling in tests with "cannot instantiate customizations until app start and lockdown"
You still need to call instance.SetAppName before calling this.
func VersionInfo ¶
func VersionInfo() versionInfo
Types ¶
This section is empty.