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

View File

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