Skip to content

Commit

Permalink
fix golang-ci lint of meatada get with context
Browse files Browse the repository at this point in the history
Signed-off-by: Paco Xu <[email protected]>
  • Loading branch information
pacoxu committed Dec 16, 2024
1 parent 4e6c9c9 commit 746581b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
strategy:
matrix:
go-versions: ['1.23', '1.22']
go-versions: ['1.22']
platform: [ubuntu-22.04]
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
runs-on: ${{ matrix.platform }}
Expand All @@ -31,7 +31,7 @@ jobs:
test-integration:
strategy:
matrix:
go-versions: ['1.23', '1.22']
go-versions: ['1.22']
platform: [ubuntu-22.04]
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
runs-on: ${{ matrix.platform }}
Expand Down
5 changes: 3 additions & 2 deletions utils/cloudinfo/gce/gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package gce

import (
"context"
"os"
"strings"

Expand Down Expand Up @@ -48,7 +49,7 @@ func (provider) IsActiveProvider() bool {
}

func (provider) GetInstanceType() info.InstanceType {
machineType, err := metadata.Get("instance/machine-type")
machineType, err := metadata.GetWithContext(context.TODO(), "instance/machine-type")
if err != nil {
return info.UnknownInstance
}
Expand All @@ -58,7 +59,7 @@ func (provider) GetInstanceType() info.InstanceType {
}

func (provider) GetInstanceID() info.InstanceID {
instanceID, err := metadata.Get("instance/id")
instanceID, err := metadata.GetWithContext(context.TODO(), "instance/id")
if err != nil {
return info.UnknownInstance
}
Expand Down

0 comments on commit 746581b

Please sign in to comment.