From 1076ebdf4aea889d2892163c853a3a8e9ece1d1d Mon Sep 17 00:00:00 2001 From: Martijn Hoekstra Date: Mon, 12 Oct 2026 03:53:24 +0200 Subject: [PATCH] test: add build constraints to Unix-only files (#11712) test/fuse_dlm, test/fuse_p2p/peer_chunk_sharing_test.go and unmaintained/check_disk_size use syscall.Flock, syscall.Stat_t and syscall.Statfs, which do not exist on Windows. Without constraints, gopls and go vet on a Windows host report them as undefined. fuse_p2p/framework_test.go already carries `linux || darwin`; the FUSE test files now match it. check_disk_size uses the same constraint as weed/stats/disk_supported.go. Co-authored-by: Claude Opus 5.5 (1M context) --- test/fuse_dlm/dlm_concurrent_write_test.go | 2 ++ test/fuse_dlm/framework_test.go | 2 ++ test/fuse_dlm/posix_lock_ring_test.go | 2 ++ test/fuse_p2p/peer_chunk_sharing_test.go | 2 ++ unmaintained/check_disk_size/check_disk_size.go | 2 ++ 5 files changed, 10 insertions(+) diff --git a/test/fuse_dlm/dlm_concurrent_write_test.go b/test/fuse_dlm/dlm_concurrent_write_test.go index 5f844e622..c56cbac73 100644 --- a/test/fuse_dlm/dlm_concurrent_write_test.go +++ b/test/fuse_dlm/dlm_concurrent_write_test.go @@ -1,3 +1,5 @@ +//go:build linux || darwin + package fuse_dlm import ( diff --git a/test/fuse_dlm/framework_test.go b/test/fuse_dlm/framework_test.go index 69f4dbfd8..fbc76414f 100644 --- a/test/fuse_dlm/framework_test.go +++ b/test/fuse_dlm/framework_test.go @@ -1,3 +1,5 @@ +//go:build linux || darwin + package fuse_dlm import ( diff --git a/test/fuse_dlm/posix_lock_ring_test.go b/test/fuse_dlm/posix_lock_ring_test.go index 62210c3fb..0874fe969 100644 --- a/test/fuse_dlm/posix_lock_ring_test.go +++ b/test/fuse_dlm/posix_lock_ring_test.go @@ -1,3 +1,5 @@ +//go:build linux || darwin + package fuse_dlm import ( diff --git a/test/fuse_p2p/peer_chunk_sharing_test.go b/test/fuse_p2p/peer_chunk_sharing_test.go index c64bc0c7f..8daf0e144 100644 --- a/test/fuse_p2p/peer_chunk_sharing_test.go +++ b/test/fuse_p2p/peer_chunk_sharing_test.go @@ -1,3 +1,5 @@ +//go:build linux || darwin + package fuse_p2p import ( diff --git a/unmaintained/check_disk_size/check_disk_size.go b/unmaintained/check_disk_size/check_disk_size.go index 4a8b92b88..c0e78f0e9 100644 --- a/unmaintained/check_disk_size/check_disk_size.go +++ b/unmaintained/check_disk_size/check_disk_size.go @@ -1,3 +1,5 @@ +//go:build !windows && !openbsd && !netbsd && !plan9 && !solaris + package main import (