Skip to content

Commit b5859e1

Browse files
committed
Rationalise build constraints for Go 1.19 onwards
This mostly involves replacing anything that was trying to be "Not Windows" with the new-in-Go-1.19 "unix" build-constraint. Effectively, anything that contained both "linux" and "freebsd" but not "windows", or excluded only "windows", is now "unix". A couple of needless constraints were removed when the filenames already carried the appropriate constraint. A handful of files were renamed, so that now "unix"-suffixed files all use the "unix" constraint, and "other" is used when the constraint is more-complex, for "no specific implementation" cases. Signed-off-by: Paul "TBBle" Hampson <[email protected]>
1 parent 590549c commit b5859e1

25 files changed

+18
-28
lines changed

cmd/nerdctl/container_top_unix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build linux || darwin || freebsd || netbsd || openbsd
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

cmd/nerdctl/main_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

cmd/nerdctl/network_create_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/buildkitutil/buildkitutil_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/cioutil/container_io_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !windows
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/cioutil/container_io_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build windows
2-
31
/*
42
Copyright The containerd Authors.
53

pkg/cmd/container/top_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build linux || darwin || freebsd || netbsd || openbsd
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/cmd/login/login_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/consoleutil/consoleutil_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !windows
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/containerutil/container_network_manager_other.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build darwin || freebsd || netbsd || openbsd
1+
//go:build !(linux || windows)
22

33
/*
44
Copyright The containerd Authors.

pkg/infoutil/infoutil_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/infoutil/infoutil_unix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/ipcutil/ipcutil_linux.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build linux
2-
31
/*
42
Copyright The containerd Authors.
53

pkg/ipcutil/ipcutil_unix.go renamed to pkg/ipcutil/ipcutil_other.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd
1+
//go:build !(linux || windows)
22

33
/*
44
Copyright The containerd Authors.

pkg/lockutil/lockutil_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/mountutil/mountutil_other.go renamed to pkg/mountutil/mountutil_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !windows
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/mountutil/mountutil_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build windows
2-
31
/*
42
Copyright The containerd Authors.
53

pkg/netutil/cni_plugin_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/netutil/netutil_linux_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build linux
2-
31
/*
42
Copyright The containerd Authors.
53

pkg/netutil/netutil_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/netutil/netutil_unix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

pkg/netutil/netutil_windows_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build windows
2-
31
/*
42
Copyright The containerd Authors.
53
File renamed without changes.

pkg/systemutil/socket_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build freebsd || linux
1+
//go:build unix
22

33
/*
44
Copyright The containerd Authors.

0 commit comments

Comments
 (0)