Skip to content

Commit

Permalink
update go version in github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpollack23 committed Sep 25, 2024
1 parent ce4239e commit f8452ce
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Improvements-647.yaml
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 4 additions & 4 deletions .github/workflows/stage-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/stage-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.21.x]
go-version: [1.23.x]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/pulumiyaml/analyser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
18 changes: 9 additions & 9 deletions pkg/pulumiyaml/codegen/gen_program_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func (m FakePackage) ResolveResource(typeName string) (pulumiyaml.ResourceTypeTo
OtherThing, OtherModule:
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("Unexpected type token in ResolveResource: %q", typeName)
return "", fmt.Errorf("Unexpected type token in ResolveResource: %q", typeName)
}
}

Expand Down Expand Up @@ -116,9 +116,9 @@ func (m FakePackage) ResolveFunction(typeName string) (pulumiyaml.FunctionTypeTo
case "test:mod:fn":
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("Unexpected type token in ResolveFunction: %q", typeName)
return "", fmt.Errorf("Unexpected type token in ResolveFunction: %q", typeName)
}

func (m FakePackage) FunctionTypeHint(typeName pulumiyaml.FunctionTypeToken) *schema.Function {
Expand All @@ -132,9 +132,9 @@ func (m FakePackage) IsComponent(typeName pulumiyaml.ResourceTypeToken) (bool, e
// note this returns if err *equals* nil.
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("Unexpected type token in IsComponent: %q", typeName)
return false, fmt.Errorf("Unexpected type token in IsComponent: %q", typeName)
}

func (m FakePackage) Name() string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/pulumiyaml/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit f8452ce

Please sign in to comment.