Skip to content

Commit

Permalink
build(go): bump golang, build with 1.22, support 1.20+
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Renatus <stephan@styra.com>
  • Loading branch information
srenatus committed Feb 20, 2024
1 parent 0d70329 commit f559627
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest]
version: ["1.19"]
version: ["1.20"]
steps:
- uses: actions/checkout@v4
- name: Download generated artifacts
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.5
1.22
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/open-policy-agent/opa

go 1.19
go 1.20

require (
github.com/OneOfOne/xxhash v1.2.8
Expand Down
145 changes: 0 additions & 145 deletions internal/prometheus/prometheus_go1.19_test.go

This file was deleted.

6 changes: 0 additions & 6 deletions topdown/tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"encoding/json"
"fmt"
"os"
"runtime"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -472,12 +471,7 @@ func TestTopdownJWTEncodeSignECWithSeedReturnsSameSignature(t *testing.T) {
"d":"jpsQnnGQmL-YBIffH1136cspYG6-0iY7X1fCE9-E9LI"
}, x)`

// go1.20 and beyond
encodedSigned := "eyJhbGciOiAiRVMyNTYifQ.eyJwYXkiOiAibG9hZCJ9.GRp6wIqDZuYnvQH50hnIy559LdrjUux76v1ynxX6lH0XtlgwreyR16x2JMnuElo79X3zUbqlWrZITICv86arew"
if strings.HasPrefix(runtime.Version(), "go1.19") { // we don't use go1.18 anymore
encodedSigned = "eyJhbGciOiAiRVMyNTYifQ.eyJwYXkiOiAibG9hZCJ9.05wmHY3NomU1jr7yvusBvKwhthRklPuJhUPOkoeIn5e5n_GXvE25EfRs9AJK2wOy6NoY2ljhj07M9BMtV0dfyA"
}

for i := 0; i < 10; i++ {
q := NewQuery(ast.MustParseBody(query)).
WithSeed(&cng{}).
Expand Down

0 comments on commit f559627

Please sign in to comment.