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
Provenance
- Commit
d1371ec- Tree
faae734- Author
Chris Broadfoot <cbro@golang.org>- Committer
Chris Broadfoot <cbro@golang.org>- Parent
1f47171
5 files changed+21 added−14 removed
modified:doc/man_docs.go+1 added-1 removed
64 unmodified lines65 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 linesmodified:.travis.yml+13 added-5 removed
12345623456789101112131415162 unmodified lines1920212223242526language: gogo: - 1.4.3 - 1.5.4 - 1.6.3 - tip
matrix: include: - go: 1.4.3 env: NOVET=true # No bundled vet. - go: 1.5.4 - go: 1.6.3 - go: 1.7 - go: tip
matrix: allow_failures: - go: tip
before_install:2 unmodified lines - chmod +x bin/shellcheckscript: - PATH=$PATH:$PWD/bin go test -v ./... - go build - diff -u <(echo -n) <(gofmt -d -s .) - if [ -z $NOVET ]; then diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); fimodified:bash_completions_test.go+1 added-1 removed
153 unmodified lines154 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 }161 162 func TestBashCompletionDeprecatedFlag(t *testing.T) {18 unmodified linesmodified:cobra_test.go+2 added-3 removed
914 unmodified lines915 }916 917 func TestRootUnknownCommandSilenced(t *testing.T) {918 r := noRRSetupTestSilenced("bogus")919- s := "Run 'cobra-test --help' for usage.\n"919 920 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 }923 924 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 }929 930 func TestRootSuggestions(t *testing.T) {257 unmodified linesmodified:command_test.go+4 added-4 removed
140 unmodified lines141 expectedNames := []string{"afirst", "middle", "zlast"}142 143 var tmpCommand = &Command{Use: "tmp"}144 145- for _, name := range(originalNames) {145+ for _, name := range originalNames {146 tmpCommand.AddCommand(&Command{Use: name})147 }148 149- 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 lines161 originalNames := []string{"middle", "zlast", "afirst"}162 163 var tmpCommand = &Command{Use: "tmp"}164 165- for _, name := range(originalNames) {165+ for _, name := range originalNames {166 tmpCommand.AddCommand(&Command{Use: name})167 }168 169- 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