-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update go1.21 and CI #315
Update go1.21 and CI #315
Conversation
Use `atomic.Bool` stdlib instead of including our own. Include `tools\mkwinsyscall` updates from go-winio/283 to switch to `syscallN`. Note: removed `// TODO` about `print`/`ln`, since the latter adds spaces between args when printing, which is undesired. Also update CI to run steps on windows-2022 instead of windows-2019, similar to our hcsshim CI. Signed-off-by: Hamza El-Saawy <[email protected]>
hvsock_test.go
Outdated
sra, ok := (sv.RemoteAddr()).(*HvsockAddr) | ||
if !ok { | ||
t.Fatalf("expected type %T; got %T", new(HvsockAddr), sv.RemoteAddr()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make this a lot cleaner by defining a function:
func MustBeType[T any](t *testing.T, v any) T {
v2, ok := v.(T)
if !ok {
t.Fatalf("expected type %T; got %T", *new(T), v)
}
return v2
}
and using it like:
sra := MustBeType[*HvsockAddr](t, sv.RemoteAddr())
This PR feels like it has a several unrelated changes, unless there's some interdepenency between them I'm not aware of. If not, it would be best to do these things as multiple PRs in the future. It's easier to review, and easier if we need to track down a specific change later on. For now though, I'm okay getting this in (pending the other comment I left). |
Looks ok but please do split unrelated changes in the future. |
The switch to go1.21 caused lint errors for the |
Signed-off-by: Hamza El-Saawy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Maybe we don't need to From the content of this PR, we only need go1.19 to meet all the required language features. At the same time, this also makes some users who still need to be compatible with older versions of Golang unable to update from (for example, it is well known that Golang1.21 has abandoned compatibility with Windows7/8, but there are still many client programs that need to run normally on outdated systems, so they need to continue to use Golang1.20) |
Update go.mod to go1.21 to match hcsshim.
Use
atomic.Bool
stdlib instead of including our own.Include
tools\mkwinsyscall
updates from #283 to switch tosyscallN
.Note: removed
// TODO
aboutprint
/ln
, since the latter adds spaces between args when printing, which is undesired.Update testing code to fix
unchecked-type-assertion
lint.Remove deprecated fields
Update CI to:
.golangci.yml