-
Notifications
You must be signed in to change notification settings - Fork 89
fix: early nil return #360
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| golang 1.24.0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ import ( | |
| "go/types" | ||
| "reflect" | ||
| "runtime/debug" | ||
| "strings" | ||
| "sync" | ||
|
|
||
| "go.uber.org/nilaway/annotation" | ||
|
|
@@ -89,15 +88,11 @@ func run(p *analysis.Pass) ([]annotation.FullTrigger, error) { | |
| return nil, nil | ||
| } | ||
|
|
||
| // Construct experimental features. By default, enable all features on NilAway itself. | ||
| functionConfig := assertiontree.FunctionConfig{} | ||
| if strings.HasPrefix(pass.Pkg.Path(), config.NilAwayPkgPathPrefix) { //nolint:revive | ||
| // TODO: enable struct initialization flag (tracked in Issue #23). | ||
| // TODO: enable anonymous function flag. | ||
| } else { | ||
| functionConfig.EnableStructInitCheck = conf.ExperimentalStructInitEnable | ||
| functionConfig.EnableAnonymousFunc = conf.ExperimentalAnonymousFuncEnable | ||
| } | ||
| // Respect driver flags for experimental features for all packages. | ||
| functionConfig := assertiontree.FunctionConfig{ | ||
| EnableStructInitCheck: conf.ExperimentalStructInitEnable, | ||
| EnableAnonymousFunc: conf.ExperimentalAnonymousFuncEnable, | ||
| } | ||
|
Comment on lines
-92
to
+95
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was there such that we can enable these experimental features on NilAway itself (to dogfood), but now that we have exposed these as proper flags we can do that at CLI level instead of hard coding it. Thanks! |
||
|
|
||
| ctrlflowResult := pass.ResultOf[ctrlflow.Analyzer].(*ctrlflow.CFGs) | ||
| anonymousFuncResult := pass.ResultOf[anonymousfunc.Analyzer].(*analysishelper.Result[map[*ast.FuncLit]*anonymousfunc.FuncLitInfo]) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| module go.uber.org/nilaway | ||
|
|
||
| go 1.23.0 | ||
|
|
||
| toolchain go1.23.4 | ||
| go 1.24.0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
|
|
||
| require ( | ||
| github.com/golangci/plugin-module-register v0.1.1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove these changes? Usually minimum Go version upgrades should be put in separate PRs where we also update CI configs, use new language features etc.