| 1 | // Copyright 2025 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package gofix defines an analyzer that checks go:fix directives. |
| 6 | package gofixscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/gofix`/ |
| 7 | |
| 8 | import ( |
| 9 | _ "embedscip-go gomod github.com/golang/go/src go1.25.0 embed/" |
| 10 | |
| 11 | "golang.org/x/tools/go/analysisscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/" |
| 12 | "golang.org/x/tools/go/analysis/passes/inspectscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inspect`/" |
| 13 | "golang.org/x/tools/go/analysis/passes/internal/gofixdirectivescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/internal/gofixdirective`/" |
| 14 | "golang.org/x/tools/go/ast/inspectorscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/ast/inspector`/" |
| 15 | "golang.org/x/tools/internal/analysis/analyzerutilscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/analysis/analyzerutil`/" |
| 16 | ) |
| 17 | |
| 18 | //go:embed doc.go |
| 19 | var docscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/gofix`/doc. string |
| 20 | |
| 21 | var Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/gofix`/Analyzer. = &analysisscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#{ |
| 22 | Namescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#Name.: "gofixdirective", |
| 23 | Docscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#Doc.: analyzerutilscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/analysis/analyzerutil`/.MustExtractDocscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/analysis/analyzerutil`/MustExtractDoc().(docscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/gofix`/doc., "gofixdirective"), |
| 24 | URLscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#URL.: "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/gofix", |
| 25 | Runscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#Run.: runscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/gofix`/run()., |
| 26 | Requiresscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#Requires.: []*analysisscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Analyzer#{inspectscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inspect`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inspect`/Analyzer.}, |
| 27 | } |
| 28 | |
| 29 | func runscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/gofix`/run().(pass *analysisscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/.Passscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Pass#) (any, error) { |
| 30 | root := pass.ResultOfscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis`/Pass#ResultOf.[inspectscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inspect`/.Analyzerscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/inspect`/Analyzer.].(*inspectorscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/ast/inspector`/.Inspectorscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/ast/inspector`/Inspector#).Rootscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/ast/inspector`/Inspector#Root().() |
| 31 | gofixdirectivescip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/internal/gofixdirective`/.Findscip-go gomod golang.org/x/tools . `golang.org/x/tools/go/analysis/passes/internal/gofixdirective`/Find().(pass, root, nil) |
| 32 | return nil, nil |
| 33 | } |