Skip to content

Commit

Permalink
Upgrade golang version to 1.21
Browse files Browse the repository at this point in the history
And fixing deprecate lint issue during the upgrade.
  • Loading branch information
jkl73 committed Apr 2, 2024
1 parent f89d9ef commit 9574ec0
Show file tree
Hide file tree
Showing 17 changed files with 908 additions and 103 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
build:
strategy:
matrix:
go-version: [1.20.x]
go-version: [1.21.x]
# TODO: Get this working on windows-latest
os: [macos-latest, ubuntu-latest]
architecture: [x32, x64]
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
lint:
strategy:
matrix:
go-version: [1.20.x]
go-version: [1.21.x]
os: [ubuntu-latest]
dir: ["./", "./cmd", "./launcher"]
name: Lint ${{ matrix.dir }} (${{ matrix.os }}, Go ${{ matrix.go-version }})
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
lintc:
strategy:
matrix:
go-version: [1.20.x]
go-version: [1.21.x]
os: [ubuntu-latest]
name: Lint CGO (${{ matrix.os }}, Go ${{ matrix.go-version }})
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
release:
strategy:
matrix:
go-version: [1.20.x]
go-version: [1.21.x]
os: [macos-latest, ubuntu-latest]

name: Release (${{ matrix.os}}, Go ${{ matrix.go-version }})
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ builds:
env:
- CGO_ENABLED=0
id: "gotpm"
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
main: ./cmd/gotpm
binary: gotpm

Expand Down
8 changes: 4 additions & 4 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cut a release (as GitHub doesn't have sufficiently advanced

## Create the main release PR

Create a standalone PR titled "Release vX.Y.Z" against the `master` branch. This
Create a standalone PR titled "Release vX.Y.Z" against the `main` branch. This
PR should (ideally) be an empty commit, but might contain some minor changes if
we want to get them in for a specific release. You can create an empty commit
by running:
Expand Down Expand Up @@ -38,7 +38,7 @@ of a single commit and be "squashed" instead of "merged".

## Tag the releases

After the new release is in the `master` branch, we need to create git tags so
After the new release is in the `main` branch, we need to create git tags so
that the Go version system can find the releases. Generally the author of the
PR should do this.

Expand Down Expand Up @@ -74,15 +74,15 @@ of a single commit and be "squashed" instead of "merged".
The submodules must be tagged separately from the main library release. This
is best done on the git command line. After the Submodule update PR has been
merged, checkout the repo and check that your `HEAD` is on the commit for the
submodule update PR on the `master` branch. This _should not_ be normal release
submodule update PR on the `main` branch. This _should not_ be normal release
commit `vX.Y.Z`, but a later commit. Then, run the following command:
```
git tag "cmd/vX.Y.Z" && git tag "launcher/vX.Y.Z"
```
replacing `vX.Y.Z` with the actual version number.

Finally, double check that you've tagged the correct commit, and then push the
tags to the `master` branch by running:
tags to the `main` branch by running:
```
git push origin "cmd/vX.Y.Z" "launcher/vX.Y.Z"
```
Expand Down
2 changes: 1 addition & 1 deletion cmd/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Which handles are flushed depends on the argument passed:
}
return keys
}(),
Args: cobra.ExactValidArgs(1),
Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
RunE: func(_ *cobra.Command, args []string) error {
rwc, err := openTpm()
if err != nil {
Expand Down
52 changes: 42 additions & 10 deletions cmd/go.mod
Original file line number Diff line number Diff line change
@@ -1,31 +1,63 @@
module github.com/google/go-tpm-tools/cmd

go 1.20
go 1.21

require (
cloud.google.com/go/compute/metadata v0.2.3
cloud.google.com/go/logging v1.9.0
github.com/containerd/containerd v1.7.14
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.3
github.com/google/go-sev-guest v0.9.3
github.com/google/go-tdx-guest v0.2.3-0.20231011100059-4cf02bed9d33
github.com/google/go-tdx-guest v0.3.1
github.com/google/go-tpm v0.9.0
github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba
github.com/google/go-tpm-tools v0.4.4
github.com/spf13/cobra v1.3.0
google.golang.org/protobuf v1.31.0
golang.org/x/oauth2 v0.18.0
google.golang.org/api v0.170.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
)

require (
cloud.google.com/go/compute v1.19.3 // indirect
github.com/golang/protobuf v1.5.3 // indirect
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/confidentialcomputing v1.5.0 // indirect
cloud.google.com/go/longrunning v0.5.5 // indirect
github.com/containerd/ttrpc v1.2.3 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/certificate-transparency-go v1.1.2 // indirect
github.com/google/go-attestation v0.5.0 // indirect
github.com/google/go-configfs-tsm v0.2.2 // indirect
github.com/google/go-tspi v0.3.0 // indirect
github.com/google/logger v1.1.1 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.3 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect
)
Loading

0 comments on commit 9574ec0

Please sign in to comment.