Skip to content

Commit 1d79904

Browse files
committed
re-vendor with go1.24.0
1 parent 179a687 commit 1d79904

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Diff for: internal/govendor/go/doc/comment/std.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: internal/govendor/go/printer/nodes.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func (p *printer) parameters(fields *ast.FieldList, mode paramMode) {
380380
if closing := p.lineFor(fields.Closing); 0 < prevLine && prevLine < closing {
381381
p.print(token.COMMA)
382382
p.linebreak(closing, 0, ignore, true)
383-
} else if mode == typeTParam && fields.NumFields() == 1 && combinesWithName(fields.List[0].Type) {
383+
} else if mode == typeTParam && fields.NumFields() == 1 && combinesWithName(stripParensAlways(fields.List[0].Type)) {
384384
// A type parameter list [P T] where the name P and the type expression T syntactically
385385
// combine to another valid (value) expression requires a trailing comma, as in [P *T,]
386386
// (or an enclosing interface as in [P interface(*T)]), so that the type parameter list
@@ -401,7 +401,7 @@ func (p *printer) parameters(fields *ast.FieldList, mode paramMode) {
401401
// combinesWithName reports whether a name followed by the expression x
402402
// syntactically combines to another valid (value) expression. For instance
403403
// using *T for x, "name *T" syntactically appears as the expression x*T.
404-
// On the other hand, using P|Q or *P|~Q for x, "name P|Q" or name *P|~Q"
404+
// On the other hand, using P|Q or *P|~Q for x, "name P|Q" or "name *P|~Q"
405405
// cannot be combined into a valid (value) expression.
406406
func combinesWithName(x ast.Expr) bool {
407407
switch x := x.(type) {
@@ -411,9 +411,7 @@ func combinesWithName(x ast.Expr) bool {
411411
case *ast.BinaryExpr:
412412
return combinesWithName(x.X) && !isTypeElem(x.Y)
413413
case *ast.ParenExpr:
414-
// name(x) combines but we are making sure at
415-
// the call site that x is never parenthesized.
416-
panic("unexpected parenthesized expression")
414+
return !isTypeElem(x.X)
417415
}
418416
return false
419417
}

Diff for: internal/govendor/go/printer/printer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ const (
4545
)
4646

4747
type commentInfo struct {
48-
cindex int // current comment index
49-
comment *ast.CommentGroup // = printer.comments[cindex]; or nil
50-
commentOffset int // = printer.posFor(printer.comments[cindex].List[0].Pos()).Offset; or infinity
48+
cindex int // index of the next comment
49+
comment *ast.CommentGroup // = printer.comments[cindex-1]; or nil
50+
commentOffset int // = printer.posFor(printer.comments[cindex-1].List[0].Pos()).Offset; or infinity
5151
commentNewline bool // true if the comment group contains newlines
5252
}
5353

Diff for: internal/govendor/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
go1.23.0
1+
go1.24.0

0 commit comments

Comments
 (0)