Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nogo: detect deprecated go standard library packages #92783

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion build/bazelutil/nogo_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,14 @@
"pkg/sql/execinfra/processorsbase.go$": "temporary exclusion until deprecatedContext is removed from eval.Context",
"pkg/sql/importer/import_table_creation.go$": "temporary exclusion until deprecatedContext is removed from eval.Context",
"pkg/sql/row/expr_walker_test.go$": "temporary exclusion until deprecatedContext is removed from eval.Context",
"pkg/sql/schemachanger/scbuild/tree_context_builder.go$": "temporary exclusion until deprecatedContext is removed from eval.Context"
"pkg/sql/schemachanger/scbuild/tree_context_builder.go$": "temporary exclusion until deprecatedContext is removed from eval.Context",
"pkg/security/securityassets/security_assets.go$": "excluded until all uses of io/ioutil are replaced",
"pkg/roachprod/install/cluster_synced.go$": "excluded until all uses of io/ioutil are replaced",
"pkg/security/securitytest/securitytest.go$": "excluded until all uses of io/ioutil are replaced",
"pkg/server/dumpstore/dumpstore.go$": "excluded until all uses of io/ioutil are replaced",
"pkg/server/dumpstore/dumpstore_test.go$": "excluded until all uses of io/ioutil are replaced",
"pkg/server/heapprofiler/profilestore_test.go$": "excluded until all uses of io/ioutil are replaced",
"pkg/util/log/file_api.go$": "excluded until all uses of io/ioutil are replaced"
},
"only_files": {
"cockroach/pkg/.*$": "first-party code"
Expand Down
11 changes: 10 additions & 1 deletion build/patches/co_honnef_go_tools.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/staticcheck/lint.go b/staticcheck/lint.go
index 85bcb21..e91e81c 100644
index 85bcb21..9fb4cc0 100644
--- a/staticcheck/lint.go
+++ b/staticcheck/lint.go
@@ -3080,6 +3080,9 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) {
Expand Down Expand Up @@ -44,3 +44,12 @@ index 85bcb21..e91e81c 100644
}
return true
}
@@ -3209,6 +3214,8 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) {
}

handleDeprecation(depr, spec.Path, path, path, nil)
+ } else if _, ok := knowledge.StdlibDeprecations[path]; ok {
+ handleDeprecation(nil, spec.Path, path, path, nil)
}
}
pass.ResultOf[inspect.Analyzer].(*inspector.Inspector).Nodes(nil, fn)