Add configuration loading + docs + linter fixes.
This commit is contained in:
@@ -19,6 +19,7 @@ func Parse(cli interface{}, options ...Option) string {
|
||||
return cmd
|
||||
}
|
||||
|
||||
// FatalIfErrorf terminates with an error message if err != nil.
|
||||
func FatalIfErrorf(err error, args ...interface{}) {
|
||||
if App == nil {
|
||||
panic("call kong.Parse() before using kong.FatalIfErrorf()")
|
||||
@@ -26,6 +27,7 @@ func FatalIfErrorf(err error, args ...interface{}) {
|
||||
App.FatalIfErrorf(err, args...)
|
||||
}
|
||||
|
||||
// Errorf writes a message to Kong.Stderr with the application name prefixed.
|
||||
func Errorf(format string, args ...interface{}) {
|
||||
if App == nil {
|
||||
panic("call kong.Parse() before using kong.Errorf()")
|
||||
@@ -33,6 +35,7 @@ func Errorf(format string, args ...interface{}) {
|
||||
App.Errorf(format, args...)
|
||||
}
|
||||
|
||||
// Printf writes a message to Kong.Stdout with the application name prefixed.
|
||||
func Printf(format string, args ...interface{}) {
|
||||
if App == nil {
|
||||
panic("call kong.Parse() before using kong.Printf()")
|
||||
|
||||
Reference in New Issue
Block a user