From b52bba477339a69d185e2fa516e4bf04f296323b Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy Date: Tue, 29 Mar 2022 12:17:12 -0400 Subject: [PATCH] Updating windows build constraints pkg/guid is not windows specific, as it can run on Linux. Build constraints on guid_windows and guid_nonwindows are redundant with file names, but added for consistency. Added missing build constraints. Added Ubuntu to test matrix, along with windows 2022. Signed-off-by: Hamza El-Saawy --- .github/workflows/ci.yml | 5 ++++- fileinfo_test.go | 3 +++ pkg/guid/guid.go | 2 -- pkg/guid/guid_nonwindows.go | 1 + pkg/guid/guid_test.go | 2 -- pkg/guid/guid_windows.go | 3 +++ reparse.go | 3 +++ 7 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b24bde4..18657c5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,10 @@ on: jobs: test: - runs-on: 'windows-2019' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2019, windows-2022, ubuntu-latest] steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 diff --git a/fileinfo_test.go b/fileinfo_test.go index e79700ba..8c97f506 100644 --- a/fileinfo_test.go +++ b/fileinfo_test.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package winio import ( diff --git a/pkg/guid/guid.go b/pkg/guid/guid.go index 2d9161e2..6e5526bd 100644 --- a/pkg/guid/guid.go +++ b/pkg/guid/guid.go @@ -1,5 +1,3 @@ -// +build windows - // Package guid provides a GUID type. The backing structure for a GUID is // identical to that used by the golang.org/x/sys/windows GUID type. // There are two main binary encodings used for a GUID, the big-endian encoding, diff --git a/pkg/guid/guid_nonwindows.go b/pkg/guid/guid_nonwindows.go index f64d828c..805bd354 100644 --- a/pkg/guid/guid_nonwindows.go +++ b/pkg/guid/guid_nonwindows.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package guid diff --git a/pkg/guid/guid_test.go b/pkg/guid/guid_test.go index 84629ee0..d7e21241 100644 --- a/pkg/guid/guid_test.go +++ b/pkg/guid/guid_test.go @@ -1,5 +1,3 @@ -// +build windows - package guid import ( diff --git a/pkg/guid/guid_windows.go b/pkg/guid/guid_windows.go index 83617f4e..27e45ee5 100644 --- a/pkg/guid/guid_windows.go +++ b/pkg/guid/guid_windows.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package guid import "golang.org/x/sys/windows" diff --git a/reparse.go b/reparse.go index fc1ee4d3..5f2f3a47 100644 --- a/reparse.go +++ b/reparse.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package winio import (