microsoft / hcsshim

Windows - Host Compute Service Shim
MIT License
564 stars 253 forks source link

[release/0.11] Update golang version in ci.yml #2189

Open kiashok opened 2 months ago

kiashok commented 2 months ago

Update ci.yml to use golang 1.20 + fix lint errors with math.Rand

This change fixes the long standing mingw errors PRs were running into in release/0.11

image

thaJeztah commented 2 months ago

Oh! All the fun, looks like we now hit the rand/read is deprecated issue;

 Error: SA1019: rand.Read has been deprecated since Go 1.20 because it shouldn't be used: For almost all use cases, crypto/rand.Read is more appropriate.  (staticcheck)
  Error: SA1019: rand.Read has been deprecated since Go 1.20 because it shouldn't be used: For almost all use cases, crypto/rand.Read is more appropriate.  (staticcheck)
  Error: SA1019: tar.TypeRegA has been deprecated since Go 1.11 and an alternative has been available since Go 1.1: Use TypeReg instead.  (staticcheck)
  Error: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access.  (staticcheck)
cmd/containerd-shim-runhcs-v1/pod_test.go:      "math/rand"
cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go: "math/rand"
cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go:        "math/rand"
cmd/containerd-shim-runhcs-v1/task_hcs_test.go: "math/rand"
ext4/dmverity/dmverity_test.go: "math/rand"
internal/cmd/io_npipe.go:       "math/rand"
internal/regopolicyinterpreter/regopolicyinterpreter_test.go:   "math/rand"
internal/tools/networkagent/main.go:    "math/rand"
pkg/securitypolicy/regopolicy_test.go:  "math/rand"
pkg/securitypolicy/securitypolicy_test.go:      "math/rand"