diff --git a/.changes/unreleased/Improvements-647.yaml b/.changes/unreleased/Improvements-647.yaml new file mode 100644 index 00000000..22859a3f --- /dev/null +++ b/.changes/unreleased/Improvements-647.yaml @@ -0,0 +1,6 @@ +component: runtime +kind: Improvements +body: Update go version for GitHub workflows +time: 2024-09-25T14:50:03.581885966+09:00 +custom: + PR: "647" diff --git a/.github/workflows/stage-lint.yml b/.github/workflows/stage-lint.yml index 136282c4..0f6ed9c1 100644 --- a/.github/workflows/stage-lint.yml +++ b/.github/workflows/stage-lint.yml @@ -7,8 +7,8 @@ permissions: read-all env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOLANGCI_LINT_VERSION: v1.55 - GO_VERSION: v1.21.x + GOLANGCI_LINT_VERSION: v1.60 + GO_VERSION: v1.23.x jobs: lint: @@ -22,7 +22,7 @@ jobs: go-version: ${{ env.GO_VERSION }} cache-dependency-path: | **/go.sum - - run: go mod tidy -go=1.21 + - run: go mod tidy -go=1.23 - name: Fail if go mod tidy changed go.mod run: | if [ -n "$(git status --porcelain)" ]; then @@ -50,6 +50,6 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.23.x - name: Lint run: make lint-copyright diff --git a/.github/workflows/stage-test.yml b/.github/workflows/stage-test.yml index 80360fbd..ad7740f0 100644 --- a/.github/workflows/stage-test.yml +++ b/.github/workflows/stage-test.yml @@ -146,4 +146,4 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.21.x] + go-version: [1.23.x] diff --git a/go.mod b/go.mod index 3932bd5d..67d445f1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/pulumi/pulumi-yaml -go 1.21 +go 1.23 require ( github.com/blang/semver v3.5.1+incompatible diff --git a/pkg/pulumiyaml/analyser.go b/pkg/pulumiyaml/analyser.go index a17e5bdf..a3a4b72e 100644 --- a/pkg/pulumiyaml/analyser.go +++ b/pkg/pulumiyaml/analyser.go @@ -1129,7 +1129,7 @@ func (tc *typeCache) typeConfig(r *Runner, node configNode) bool { func (tc *typeCache) typeMissing(r *Runner, node missingNode) bool { ctx := r.newContext(node) - ctx.errorf(node.key(), fmt.Sprintf("resource, variable, or config value %q not found", node.key().Value)) + ctx.errorf(node.key(), "resource, variable, or config value %q not found", node.key().Value) return false } diff --git a/pkg/pulumiyaml/codegen/gen_program_test.go b/pkg/pulumiyaml/codegen/gen_program_test.go index 4b614523..ec8dbc8e 100644 --- a/pkg/pulumiyaml/codegen/gen_program_test.go +++ b/pkg/pulumiyaml/codegen/gen_program_test.go @@ -4,6 +4,7 @@ package codegen import ( "encoding/json" + "errors" "fmt" "os" "path/filepath" @@ -65,8 +66,8 @@ func (m FakePackage) ResolveResource(typeName string) (pulumiyaml.ResourceTypeTo return pulumiyaml.ResourceTypeToken(typeName), nil default: msg := fmt.Sprintf("Unexpected type token in ResolveResource: %q", typeName) - m.t.Logf(msg) - return "", fmt.Errorf(msg) + m.t.Logf("%s", msg) + return "", errors.New(msg) } } @@ -117,8 +118,8 @@ func (m FakePackage) ResolveFunction(typeName string) (pulumiyaml.FunctionTypeTo return pulumiyaml.FunctionTypeToken(typeName), nil } msg := fmt.Sprintf("Unexpected type token in ResolveFunction: %q", typeName) - m.t.Logf(msg) - return "", fmt.Errorf(msg) + m.t.Logf("%s", msg) + return "", errors.New(msg) } func (m FakePackage) FunctionTypeHint(typeName pulumiyaml.FunctionTypeToken) *schema.Function { @@ -133,8 +134,8 @@ func (m FakePackage) IsComponent(typeName pulumiyaml.ResourceTypeToken) (bool, e return false, nil } msg := fmt.Sprintf("Unexpected type token in IsComponent: %q", typeName) - m.t.Logf(msg) - return false, fmt.Errorf(msg) + m.t.Logf("%s", msg) + return false, errors.New(msg) } func (m FakePackage) Name() string { diff --git a/pkg/pulumiyaml/run.go b/pkg/pulumiyaml/run.go index 5d21ed93..b7b390fe 100644 --- a/pkg/pulumiyaml/run.go +++ b/pkg/pulumiyaml/run.go @@ -1064,7 +1064,7 @@ func (e *programEvaluator) registerConfig(intm configNode) (interface{}, bool) { if errors.Is(err, config.ErrMissingVar) && defaultValue != nil { v = defaultValue } else if err != nil { - return e.errorf(intmKey, err.Error()) + return e.errorf(intmKey, "%s", err.Error()) } contract.Assertf(v != nil, "let an uninitialized var slip through")