Skip to content

Commit

Permalink
chore(gha): fix macos action/setup-go@v4 cache miss.
Browse files Browse the repository at this point in the history
Set the same Go version as specified in the `go.mod`
because of the issue below:
- actions/setup-go#424

Additionally, the rand.Seed() was updated to use
rand.New(rand.NewSource(seed)) because the former was
removed from Go1.20.

Signed-off-by: Tiago Natel <t.nateldemoura@gmail.com>
  • Loading branch information
i4ki committed Feb 2, 2024
1 parent 017241e commit 1ec5ab9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/terramate/cli/cloud_credential_google.go
Expand Up @@ -148,13 +148,13 @@ func startServer(
}
}()

rand.Seed(time.Now().UnixNano())
rng := rand.New(rand.NewSource(time.Now().UnixNano()))

var ln net.Listener
const maxretry = 5
var retry int
for retry = 0; retry < maxretry; retry++ {
addr := "127.0.0.1:" + strconv.Itoa(minPort+rand.Intn(maxPort-minPort))
addr := "127.0.0.1:" + strconv.Itoa(minPort+rng.Intn(maxPort-minPort))
s.Addr = addr

ln, err = net.Listen("tcp", addr)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/terramate-io/terramate

go 1.18
go 1.20

require (
github.com/alecthomas/kong v0.7.1
Expand Down

0 comments on commit 1ec5ab9

Please sign in to comment.