From eca4996a7b04ed001eceead0d583b32e33cb40f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 3 Nov 2025 23:24:29 +0000 Subject: [PATCH] all: remove three func results which are never used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Martí Change-Id: Id783170eda30fd69c93bdf1411b65f0540860bd5 Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1225600 TryBot-Result: CUEcueckoo Reviewed-by: Roger Peppe Unity-Result: CUE porcuepine --- cmd/cue/cmd/get_go.go | 4 +--- encoding/protobuf/util.go | 7 ++----- internal/core/compile/compile.go | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cmd/cue/cmd/get_go.go b/cmd/cue/cmd/get_go.go index cd80958ee..517d9be28 100644 --- a/cmd/cue/cmd/get_go.go +++ b/cmd/cue/cmd/get_go.go @@ -898,13 +898,11 @@ func (e *extractor) altType(typ types.Type) cueast.Expr { return nil } -func addDoc(g *ast.CommentGroup, x cueast.Node) bool { +func addDoc(g *ast.CommentGroup, x cueast.Node) { doc := makeDoc(g, true) if doc != nil { cueast.AddComment(x, doc) - return true } - return false } func makeDoc(g *ast.CommentGroup, isDoc bool) *cueast.CommentGroup { diff --git a/encoding/protobuf/util.go b/encoding/protobuf/util.go index 13afa5032..43949ebde 100644 --- a/encoding/protobuf/util.go +++ b/encoding/protobuf/util.go @@ -40,18 +40,15 @@ type protoError struct { error } -var ( - newSection = token.NewSection.Pos() -) +var newSection = token.NewSection.Pos() -func addComments(f ast.Node, i int, doc, inline *proto.Comment) bool { +func addComments(f ast.Node, i int, doc, inline *proto.Comment) { cg := comment(doc, true) if cg != nil && len(cg.List) > 0 && i > 0 { cg.List[0].Slash = newSection } ast.AddComment(f, cg) ast.AddComment(f, comment(inline, false)) - return doc != nil } func comment(c *proto.Comment, doc bool) *ast.CommentGroup { diff --git a/internal/core/compile/compile.go b/internal/core/compile/compile.go index 78094bc59..e9cf787d9 100644 --- a/internal/core/compile/compile.go +++ b/internal/core/compile/compile.go @@ -1201,12 +1201,11 @@ func listEllipsis(n *ast.ListLit) (elts []ast.Expr, e *ast.Ellipsis) { return elts, e } -func (c *compiler) assertConcreteIsPossible(src ast.Node, op adt.Op, x adt.Expr) bool { +func (c *compiler) assertConcreteIsPossible(src ast.Node, op adt.Op, x adt.Expr) { if !adt.AssertConcreteIsPossible(op, x) { str := astinternal.DebugStr(src) c.errf(src, "invalid operand %s ('%s' requires concrete value)", str, op) } - return false } func (c *compiler) addDisjunctionElem(d *adt.DisjunctionExpr, n ast.Expr, mark bool) { -- 2.51.2