aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2026-03-28 14:40:24 -0400
committerJonathan Amsterdam <jba@google.com>2026-03-30 13:40:47 -0700
commit553cc7bbf577a297ad6e78870316bdf5e4c19e04 (patch)
treeca43ec10c3dad724a72312f1afe80026c9d1ba36
parented9f544b260433d32a59bb7e9b52d7cafda78eec (diff)
downloadgo-x-pkgsite-553cc7bbf577a297ad6e78870316bdf5e4c19e04.tar.xz
all.bash: re-enable unparam
It's working now. Also fix, issues that it detected. Change-Id: Ifd3fe5baf9a56d31bafe099bf4b38e02356bde21 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/760582 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
-rwxr-xr-xall.bash6
-rw-r--r--cmd/internal/pkgsite/server.go2
-rw-r--r--internal/fetch/load.go8
-rw-r--r--internal/worker/excluded.go4
4 files changed, 10 insertions, 10 deletions
diff --git a/all.bash b/all.bash
index a8d81c2c..de916ea8 100755
--- a/all.bash
+++ b/all.bash
@@ -140,10 +140,8 @@ check_bad_migrations() {
# check_unparam runs unparam on source files.
check_unparam() {
- echo "unparam disabled until ssa supports generics"
- # TODO: uncomment when working
- # ensure_go_binary mvdan.cc/unparam
- # runcmd unparam ./...
+ ensure_go_binary mvdan.cc/unparam
+ runcmd unparam ./...
}
# check_vet runs go vet on source files.
diff --git a/cmd/internal/pkgsite/server.go b/cmd/internal/pkgsite/server.go
index 32986a54..d1fb19d7 100644
--- a/cmd/internal/pkgsite/server.go
+++ b/cmd/internal/pkgsite/server.go
@@ -123,7 +123,7 @@ func BuildServer(ctx context.Context, serverCfg ServerConfig) (*frontend.Server,
//
// An error is returned if any operations failed unexpectedly, or if no
// requested directories contain any valid modules.
-func getModuleDirs(ctx context.Context, dirs []string, goRepoPath string, allowNoModules bool) (map[string][]frontend.LocalModule, error) {
+func getModuleDirs(_ context.Context, dirs []string, goRepoPath string, allowNoModules bool) (map[string][]frontend.LocalModule, error) {
dirModules := make(map[string][]frontend.LocalModule)
for _, dir := range dirs {
output, err := runGo(dir, "list", "-m", "-json")
diff --git a/internal/fetch/load.go b/internal/fetch/load.go
index bde5469d..e8f03316 100644
--- a/internal/fetch/load.go
+++ b/internal/fetch/load.go
@@ -51,7 +51,8 @@ func (bpe *BadPackageError) Error() string { return bpe.Err.Error() }
// If a package is fine except that its documentation is too large, loadPackage
// returns a goPackage whose err field is a non-nil error with godoc.ErrTooLarge in its chain.
func loadPackage(ctx context.Context, contentDir fs.FS, goFilePaths []string, innerPath string,
- sourceInfo *source.Info, modInfo *godoc.ModuleInfo) (_ *goPackage, err error) {
+ sourceInfo *source.Info, modInfo *godoc.ModuleInfo,
+) (_ *goPackage, err error) {
defer derrors.Wrap(&err, "loadPackage(ctx, zipGoFiles, %q, sourceInfo, modInfo)", innerPath)
ctx, span := trace.StartSpan(ctx, "fetch.loadPackage")
defer span.End()
@@ -185,7 +186,7 @@ func loadPackage(ctx context.Context, contentDir fs.FS, goFilePaths []string, in
// loadPackageMeta loads only the parts of a package that are needed to load a
// packageMeta.
-func loadPackageMeta(ctx context.Context, contentDir fs.FS, goFilePaths []string, innerPath string, modInfo *godoc.ModuleInfo) (_ *packageMeta, err error) {
+func loadPackageMeta(_ context.Context, contentDir fs.FS, goFilePaths []string, innerPath string, modInfo *godoc.ModuleInfo) (_ *packageMeta, err error) {
defer derrors.Wrap(&err, "loadPackageMeta(ctx, zipGoFiles, %q, sourceInfo, modInfo)", innerPath)
// Make a map with all the zip file contents.
@@ -285,7 +286,8 @@ var httpPost = http.Post
// If it returns an error with ErrTooLarge in its chain, the other return values
// are still valid.
func loadPackageForBuildContext(ctx context.Context, files map[string][]byte, innerPath string, sourceInfo *source.Info, modInfo *godoc.ModuleInfo) (
- name string, imports []string, synopsis string, source []byte, api []*internal.Symbol, err error) {
+ name string, imports []string, synopsis string, source []byte, api []*internal.Symbol, err error,
+) {
modulePath := modInfo.ModulePath
defer derrors.Wrap(&err, "loadPackageWithBuildContext(files, %q, %q, %+v)", innerPath, modulePath, sourceInfo)
diff --git a/internal/worker/excluded.go b/internal/worker/excluded.go
index cec802a0..9e8c7c37 100644
--- a/internal/worker/excluded.go
+++ b/internal/worker/excluded.go
@@ -55,7 +55,7 @@ func PopulateExcluded(ctx context.Context, cfg *config.Config, db *postgres.DB)
}
}
defer r.Close()
- lines, err := readExcludedLines(ctx, r)
+ lines, err := readExcludedLines(r)
if err != nil {
return err
}
@@ -77,7 +77,7 @@ func PopulateExcluded(ctx context.Context, cfg *config.Config, db *postgres.DB)
return nil
}
-func readExcludedLines(ctx context.Context, r io.Reader) ([]exclusion, error) {
+func readExcludedLines(r io.Reader) ([]exclusion, error) {
var lines []exclusion
s := bufio.NewScanner(r)
for s.Scan() {