Skip to content

Commit

Permalink
fix vet fmt mismatch errors
Browse files Browse the repository at this point in the history
The latest Go version picks up these format string mismatches, so
fix them.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I80a3779e569122950e30e572942b05ad69acf868
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200762
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
rogpeppe authored and mvdan committed Sep 6, 2024
1 parent 3413f77 commit 3988f4f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cue/load/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func findTags(b *build.Instance) (tags []*tag, errs errors.Error) {
if f, ok := n.(*ast.Field); ok {
for _, a := range f.Attrs {
if key, _ := a.Split(); key == "tag" {
errs = errors.Append(errs, errors.Newf(a.Pos(), msg))
errs = errors.Append(errs, errors.Newf(a.Pos(), "%s", msg))
// TODO: add position of x.
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/core/compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ func (c *compiler) parse(l *ast.BasicLit) (n adt.Expr) {
case token.STRING:
info, nStart, _, err := literal.ParseQuotes(s, s)
if err != nil {
return c.errf(l, err.Error())
return c.errf(l, "%s", err.Error())
}
s := s[nStart:]
return parseString(c, l, info, s)
Expand Down
2 changes: 1 addition & 1 deletion internal/golangorgx/gopls/cache/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ func (s *Snapshot) initialize(ctx context.Context, firstAttempt bool) {
}
case len(modDiagnostics) > 0:
initialErr = &InitializationError{
MainError: fmt.Errorf(modDiagnostics[0].Message),
MainError: fmt.Errorf("%s", modDiagnostics[0].Message),
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/golangorgx/gopls/test/integration/fake/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ func (e *Editor) SaveBufferWithoutActions(ctx context.Context, path string) erro
defer e.mu.Unlock()
buf, ok := e.buffers[path]
if !ok {
return fmt.Errorf(fmt.Sprintf("unknown buffer: %q", path))
return fmt.Errorf("unknown buffer: %q", path)
}
content := buf.text()
includeText := false
Expand Down

0 comments on commit 3988f4f

Please sign in to comment.