Skip to content

Commit

Permalink
all: staticcheck style checks
Browse files Browse the repository at this point in the history
Mostly minor changes.

  > staticcheck ./...
  build/builder.go:196:25: error strings should not end with punctuation or a newline (ST1005)
  build/ctags.go:88:25: error strings should not end with punctuation or a newline (ST1005)
  cmd/zoekt-webserver/main.go:83:21: error strings should not be capitalized (ST1005)
  eval.go:408:25: error strings should not end with punctuation or a newline (ST1005)
  gitindex/tree.go:54:25: error strings should not end with punctuation or a newline (ST1005)
  indexbuilder.go:212:20: error strings should not end with punctuation or a newline (ST1005)
  indexbuilder.go:228:20: error strings should not end with punctuation or a newline (ST1005)

Change-Id: I6afefcb7b877479bd3939fb400e75890da341021
  • Loading branch information
keegancsmith authored and hanwen committed Dec 10, 2018
1 parent 71eea24 commit 1a48035
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func NewBuilder(opts Options) (*Builder, error) {
}

if b.opts.CTags == "" && b.opts.CTagsMustSucceed {
return nil, fmt.Errorf("ctags binary not found, but CTagsMustSucceed set.")
return nil, fmt.Errorf("ctags binary not found, but CTagsMustSucceed set")
}

if strings.Contains(opts.CTags, "universal-ctags") {
Expand Down
2 changes: 1 addition & 1 deletion build/ctags.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func runCTags(bin string, inputs map[string][]byte) ([]*ctags.Entry, error) {
select {
case <-timeout:
cmd.Process.Kill()
return nil, fmt.Errorf("timeout executing ctags.")
return nil, fmt.Errorf("timeout executing ctags")
case err := <-errChan:
if err != nil {
return nil, fmt.Errorf("exec(%s): %v, stderr: %s", cmd.Args, err, errBuf.String())
Expand Down
2 changes: 1 addition & 1 deletion cmd/zoekt-webserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func loadTemplates(tpl *template.Template, dir string) error {
base := filepath.Base(fn)
base = strings.TrimSuffix(base, templateExtension)
if _, err := tpl.New(base).Parse(string(content)); err != nil {
return fmt.Errorf("Parse(%s): %v", fn, err)
return fmt.Errorf("template.Parse(%s): %v", fn, err)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (d *indexData) List(ctx context.Context, q query.Q) (rl *RepoList, err erro
c, ok := q.(*query.Const)

if !ok {
return nil, fmt.Errorf("List should receive Repo-only query.")
return nil, fmt.Errorf("List should receive Repo-only query")
}

l := &RepoList{}
Expand Down
2 changes: 1 addition & 1 deletion gitindex/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type repoWalker struct {
// subURL returns the URL for a submodule.
func (w *repoWalker) subURL(relURL string) (*url.URL, error) {
if w.repoURL == nil {
return nil, fmt.Errorf("no URL for base repo.")
return nil, fmt.Errorf("no URL for base repo")
}
if strings.HasPrefix(relURL, "../") {
u := *w.repoURL
Expand Down
4 changes: 2 additions & 2 deletions indexbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func NewIndexBuilder(r *Repository) (*IndexBuilder, error) {

func (b *IndexBuilder) setRepository(desc *Repository) error {
if len(b.contentStrings) > 0 {
return fmt.Errorf("AddSubRepository called after adding files.")
return fmt.Errorf("setRepository called after adding files")
}
if err := desc.verify(); err != nil {
return err
Expand All @@ -225,7 +225,7 @@ func (b *IndexBuilder) setRepository(desc *Repository) error {
}

if len(desc.Branches) > 64 {
return fmt.Errorf("too many branches.")
return fmt.Errorf("too many branches")
}

b.repo = *desc
Expand Down

0 comments on commit 1a48035

Please sign in to comment.