-
Notifications
You must be signed in to change notification settings - Fork 1
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
Upgrade to Go 1.23 and golang.org/x to 0.21.0 #278
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 |
---|---|---|
|
@@ -98,7 +98,7 @@ var getRepoKind = stepv2.Func11E("Get Repo Kind", func(ctx context.Context, repo | |
if err != nil { | ||
return nil, fmt.Errorf("%s: %w", bridgeMissingMsg, err) | ||
} else if !ok { | ||
return nil, fmt.Errorf(bridgeMissingMsg) | ||
return nil, fmt.Errorf("%s", bridgeMissingMsg) | ||
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. Fixed: non-constant format string in call to fmt.Errorf |
||
} | ||
|
||
pf, ok, err := originalGoVersionOf(ctx, repo, filepath.Join("provider", "go.mod"), "github.com/pulumi/pulumi-terraform-bridge/pf") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ const ( | |
func AutoAliasingMigration(resourcesFilePath, providerName string) (bool, error) { | ||
// Create the AST by parsing src | ||
fset := token.NewFileSet() | ||
file, err := parser.ParseFile(fset, resourcesFilePath, nil, parser.ParseComments) | ||
file, err := parser.ParseFile(fset, resourcesFilePath, nil, parser.ParseComments|parser.SkipObjectResolution) | ||
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. Syntactic object resolution is deprecated now including We don't need object resolution because we're doing ast manipulation and not analysis or resolving symbols across scopes. |
||
if err != nil { | ||
return false, err | ||
} | ||
|
@@ -96,7 +96,7 @@ func AutoAliasingMigration(resourcesFilePath, providerName string) (bool, error) | |
} | ||
c.InsertBefore(&ast.AssignStmt{ | ||
Tok: tok, | ||
Lhs: []ast.Expr{&ast.Ident{Name: "err", Obj: &ast.Object{Kind: ast.Var, Name: "err"}}}, | ||
Lhs: []ast.Expr{&ast.Ident{Name: "err"}}, | ||
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.
|
||
Rhs: []ast.Expr{&ast.CallExpr{ | ||
Fun: &ast.SelectorExpr{ | ||
X: &ast.Ident{Name: "x"}, | ||
|
@@ -105,11 +105,11 @@ func AutoAliasingMigration(resourcesFilePath, providerName string) (bool, error) | |
Args: []ast.Expr{ | ||
&ast.UnaryExpr{ | ||
Op: token.AND, | ||
X: &ast.Ident{Name: "prov", Obj: &ast.Object{Kind: ast.Var, Name: "prov"}}, | ||
X: &ast.Ident{Name: "prov"}, | ||
}, | ||
&ast.CallExpr{ | ||
Fun: &ast.SelectorExpr{ | ||
X: &ast.Ident{Name: "prov", Obj: &ast.Object{Kind: ast.Var, Name: "prov"}}, | ||
X: &ast.Ident{Name: "prov"}, | ||
Sel: &ast.Ident{Name: "GetMetadata"}, | ||
}, | ||
}, | ||
|
@@ -123,7 +123,7 @@ func AutoAliasingMigration(resourcesFilePath, providerName string) (bool, error) | |
Sel: &ast.Ident{Name: "AssertNoErrorf"}, | ||
}, | ||
Args: []ast.Expr{ | ||
&ast.Ident{Name: "err", Obj: &ast.Object{Kind: ast.Var, Name: "err"}}, | ||
&ast.Ident{Name: "err"}, | ||
&ast.BasicLit{Kind: token.STRING, Value: "\"auto aliasing apply failed\""}, | ||
}, | ||
}}) | ||
|
@@ -140,7 +140,7 @@ func AutoAliasingMigration(resourcesFilePath, providerName string) (bool, error) | |
Tok: token.VAR, | ||
Specs: []ast.Spec{ | ||
&ast.ValueSpec{ | ||
Names: []*ast.Ident{{Name: "metadata", Obj: &ast.Object{Kind: ast.Var, Name: "metadata"}}}, | ||
Names: []*ast.Ident{{Name: "metadata"}}, | ||
Type: &ast.ArrayType{Elt: &ast.Ident{Name: "byte // EMBED_DIRECTIVE_ANCHOR"}}, | ||
}, | ||
}, | ||
|
@@ -179,7 +179,7 @@ func AssertNoErrorMigration(resourcesFilePath, providerName string) (bool, error | |
Sel: &ast.Ident{Name: "AssertNoErrorf"}, | ||
}, | ||
Args: []ast.Expr{ | ||
&ast.Ident{Name: "err", Obj: &ast.Object{Kind: ast.Var, Name: "err"}}, | ||
&ast.Ident{Name: "err"}, | ||
&ast.BasicLit{Kind: token.STRING, Value: "\"failed to apply auto token mapping\""}, | ||
}, | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,7 @@ func UpgradeProvider(ctx context.Context, repoOrg, repoName string) (err error) | |
return err | ||
} | ||
defer func() { | ||
fmt.Printf("\n\n" + colorize.Warn("Major Version Updates are not fully automated!") + "\n") | ||
fmt.Printf("\n\n%s\n", colorize.Warn("Major Version Updates are not fully automated!")) | ||
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. Fixed: non-constant format string in call to fmt.Printf |
||
fmt.Printf("%s need to complete Step 11: Updating README.md and sdk/python/README.md "+ | ||
"in a follow up commit.\n", colorize.Bold("You")) | ||
fmt.Printf("Steps are listed at\n\t" + | ||
|
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.
Addresses linter warning SA1029: should not use empty anonymous struct as key for value; define your own type to avoid collisions