From: Alan Donovan Date: Wed, 15 Oct 2025 20:28:03 +0000 (-0400) Subject: cmd: fix three printf problems reported by newest vet X-Git-Tag: go1.26rc1~604 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f1fed742eb;p=gostls13.git cmd: fix three printf problems reported by newest vet Change-Id: Id70985d217c940eb022dbc95bfaa20373672512c Reviewed-on: https://go-review.googlesource.com/c/go/+/712220 Auto-Submit: Alan Donovan TryBot-Bypass: Alan Donovan Commit-Queue: Alan Donovan Reviewed-by: Cherry Mui --- diff --git a/src/cmd/go/internal/modload/vendor.go b/src/cmd/go/internal/modload/vendor.go index bf0c4e4037..1fc20ad398 100644 --- a/src/cmd/go/internal/modload/vendor.go +++ b/src/cmd/go/internal/modload/vendor.go @@ -188,7 +188,7 @@ func checkVendorConsistency(loaderstate *State, indexes []*modFileIndex, modFile // However, we can at least detect a version mismatch if packages were // vendored from a non-matching version. if vv, ok := vendorVersion[r.Mod.Path]; ok && vv != r.Mod.Version { - vendErrorf(r.Mod, fmt.Sprintf("is explicitly required in go.mod, but vendor/modules.txt indicates %s@%s", r.Mod.Path, vv)) + vendErrorf(r.Mod, "is explicitly required in go.mod, but vendor/modules.txt indicates %s@%s", r.Mod.Path, vv) } } else { vendErrorf(r.Mod, "is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt") diff --git a/src/cmd/internal/obj/loong64/asm.go b/src/cmd/internal/obj/loong64/asm.go index ccf093ca9e..5a61acac87 100644 --- a/src/cmd/internal/obj/loong64/asm.go +++ b/src/cmd/internal/obj/loong64/asm.go @@ -4438,7 +4438,7 @@ func (c *ctxt0) specialFpMovInst(a obj.As, fclass int, tclass int) uint32 { } } - c.ctxt.Diag("bad class combination: %s %d,%s\n", a, fclass, tclass) + c.ctxt.Diag("bad class combination: %s %d,%d\n", a, fclass, tclass) return 0 } diff --git a/src/cmd/internal/obj/riscv/obj.go b/src/cmd/internal/obj/riscv/obj.go index 4a9c54a396..74699cc398 100644 --- a/src/cmd/internal/obj/riscv/obj.go +++ b/src/cmd/internal/obj/riscv/obj.go @@ -2991,7 +2991,7 @@ func (ins *instruction) length() int { func (ins *instruction) validate(ctxt *obj.Link) { enc, err := encodingForAs(ins.as) if err != nil { - ctxt.Diag(err.Error()) + ctxt.Diag("%v", err) return } enc.validate(ctxt, ins)