Skip to content

Commit 6c65b0b

Browse files
committed
Merge master
2 parents 21bf051 + 63229bc commit 6c65b0b

File tree

498 files changed

+10234
-7154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

498 files changed

+10234
-7154
lines changed

blog/blog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ type rootData struct {
420420
BasePath string
421421
GodocURL string
422422
AnalyticsHTML template.HTML
423-
Data interface{}
423+
Data any
424424
}
425425

426426
// ServeHTTP serves the front, index, and article pages

cmd/bundle/gotypesalias.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

cmd/callgraph/gotypesalias.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

cmd/callgraph/main_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// No testdata on Android.
66

77
//go:build !android && go1.11
8-
// +build !android,go1.11
98

109
package main
1110

cmd/deadcode/deadcode.go

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func main() {
175175
}
176176
}
177177

178-
if isGenerated(file) {
178+
if ast.IsGenerated(file) {
179179
generated[p.Fset.File(file.Pos()).Name()] = true
180180
}
181181
}
@@ -414,45 +414,6 @@ func printObjects(format string, objects []any) {
414414
}
415415
}
416416

417-
// TODO(adonovan): use go1.21's ast.IsGenerated.
418-
419-
// isGenerated reports whether the file was generated by a program,
420-
// not handwritten, by detecting the special comment described
421-
// at https://go.dev/s/generatedcode.
422-
//
423-
// The syntax tree must have been parsed with the ParseComments flag.
424-
// Example:
425-
//
426-
// f, err := parser.ParseFile(fset, filename, src, parser.ParseComments|parser.PackageClauseOnly)
427-
// if err != nil { ... }
428-
// gen := ast.IsGenerated(f)
429-
func isGenerated(file *ast.File) bool {
430-
_, ok := generator(file)
431-
return ok
432-
}
433-
434-
func generator(file *ast.File) (string, bool) {
435-
for _, group := range file.Comments {
436-
for _, comment := range group.List {
437-
if comment.Pos() > file.Package {
438-
break // after package declaration
439-
}
440-
// opt: check Contains first to avoid unnecessary array allocation in Split.
441-
const prefix = "// Code generated "
442-
if strings.Contains(comment.Text, prefix) {
443-
for _, line := range strings.Split(comment.Text, "\n") {
444-
if rest, ok := strings.CutPrefix(line, prefix); ok {
445-
if gen, ok := strings.CutSuffix(rest, " DO NOT EDIT."); ok {
446-
return gen, true
447-
}
448-
}
449-
}
450-
}
451-
}
452-
}
453-
return "", false
454-
}
455-
456417
// pathSearch returns the shortest path from one of the roots to one
457418
// of the targets (along with the root itself), or zero if no path was found.
458419
func pathSearch(roots []*ssa.Function, res *rta.Result, targets map[*ssa.Function]bool) (*callgraph.Node, []*callgraph.Edge) {

cmd/deadcode/gotypesalias.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

cmd/eg/gotypesalias.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

cmd/fiximports/main_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// No testdata on Android.
66

77
//go:build !android
8-
// +build !android
98

109
package main
1110

cmd/godex/gotypesalias.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

cmd/godex/isAlias18.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build !go1.9
6-
// +build !go1.9
76

87
package main
98

0 commit comments

Comments
 (0)