Update examples to use correct naming convention

See https://golang.org/pkg/testing/#hdr-Examples
This commit is contained in:
Jesse Szwedko 2015-11-15 13:07:28 -08:00
parent 49bed4ccde
commit 4fc241fb17
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ import (
"testing" "testing"
) )
func ExampleApp() { func ExampleApp_Run() {
// set args for examples sake // set args for examples sake
os.Args = []string{"greet", "--name", "Jeremy"} os.Args = []string{"greet", "--name", "Jeremy"}
@ -30,7 +30,7 @@ func ExampleApp() {
// Hello Jeremy // Hello Jeremy
} }
func ExampleAppSubcommand() { func ExampleApp_Run_subcommand() {
// set args for examples sake // set args for examples sake
os.Args = []string{"say", "hi", "english", "--name", "Jeremy"} os.Args = []string{"say", "hi", "english", "--name", "Jeremy"}
app := NewApp() app := NewApp()
@ -67,7 +67,7 @@ func ExampleAppSubcommand() {
// Hello, Jeremy // Hello, Jeremy
} }
func ExampleAppHelp() { func ExampleApp_Run_help() {
// set args for examples sake // set args for examples sake
os.Args = []string{"greet", "h", "describeit"} os.Args = []string{"greet", "h", "describeit"}
@ -99,7 +99,7 @@ func ExampleAppHelp() {
// This is how we describe describeit the function // This is how we describe describeit the function
} }
func ExampleAppBashComplete() { func ExampleApp_Run_bashComplete() {
// set args for examples sake // set args for examples sake
os.Args = []string{"greet", "--generate-bash-completion"} os.Args = []string{"greet", "--generate-bash-completion"}

View File

@ -4,7 +4,7 @@ import (
"os" "os"
) )
func Example() { func Example_App_Run() {
app := NewApp() app := NewApp()
app.Name = "todo" app.Name = "todo"
app.Usage = "task list on the command line" app.Usage = "task list on the command line"
@ -30,7 +30,7 @@ func Example() {
app.Run(os.Args) app.Run(os.Args)
} }
func ExampleSubcommand() { func Example_App_Run_subcommand() {
app := NewApp() app := NewApp()
app.Name = "say" app.Name = "say"
app.Commands = []Command{ app.Commands = []Command{