Skip to content
Myr

gofmt, govet, run those in Travis, add 1.7

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Chris Broadfoot · committed by Chris Broadfoot · parent 1f47171 · Browse files · 5 files+21 added−14 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+21 added−14 removed

  • other:+21 added−14 removed

5 files+21 added−14 removed

modified:doc/man_docs.go+1 added-1 removed
64 unmodified lines
65 if opts.CommandSeparator != "" {66 separator = opts.CommandSeparator67 }68 basename := strings.Replace(cmd.CommandPath(), " ", separator, -1)69 filename := filepath.Join(opts.Path, basename + "." + section)69 filename := filepath.Join(opts.Path, basename+"."+section)70 f, err := os.Create(filename)71 if err != nil {72 return err73 }
158 unmodified lines
modified:.travis.yml+13 added-5 removed
modified:bash_completions_test.go+1 added-1 removed
153 unmodified lines
154 out := new(bytes.Buffer)155 cmdTrue.GenBashCompletion(out)156 bashCompletion := out.String()157 if strings.Contains(bashCompletion, flagName) {158 t.Error("expected completion to not include %q flag: Got %v", flagName, bashCompletion)158 t.Errorf("expected completion to not include %q flag: Got %v", flagName, bashCompletion)159 }160}161162func TestBashCompletionDeprecatedFlag(t *testing.T) {
18 unmodified lines
modified:cobra_test.go+2 added-3 removed
914 unmodified lines
915}916917func TestRootUnknownCommandSilenced(t *testing.T) {918 r := noRRSetupTestSilenced("bogus")919 s := "Run 'cobra-test --help' for usage.\n"919920 if r.Output != "" {922 t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)921 t.Errorf("Unexpected response.\nExpecting to be: \n\"\"\n Got:\n %q\n", r.Output)922 }923924 r = noRRSetupTestSilenced("--strtwo=a bogus")925 if r.Output != "" {927 t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)926 t.Errorf("Unexpected response.\nExpecting to be:\n\"\"\nGot:\n %q\n", r.Output)927 }928}929930func TestRootSuggestions(t *testing.T) {
257 unmodified lines
modified:command_test.go+4 added-4 removed
140 unmodified lines
141 expectedNames := []string{"afirst", "middle", "zlast"}142143 var tmpCommand = &Command{Use: "tmp"}144145 for _, name := range(originalNames) {145 for _, name := range originalNames {146 tmpCommand.AddCommand(&Command{Use: name})147 }148149 for i, c := range(tmpCommand.Commands()) {149 for i, c := range tmpCommand.Commands() {150 if expectedNames[i] != c.Name() {151 t.Errorf("expected: %s, got: %s", expectedNames[i], c.Name())152 }153 }
7 unmodified lines
161 originalNames := []string{"middle", "zlast", "afirst"}162163 var tmpCommand = &Command{Use: "tmp"}164165 for _, name := range(originalNames) {165 for _, name := range originalNames {166 tmpCommand.AddCommand(&Command{Use: name})167 }168169 for i, c := range(tmpCommand.Commands()) {169 for i, c := range tmpCommand.Commands() {170 if originalNames[i] != c.Name() {171 t.Errorf("expected: %s, got: %s", originalNames[i], c.Name())172 }173 }
3 unmodified lines