From 8e39fcb2b3397a1bfb0b5396afa1e1697e5e26b8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 7 Feb 2019 17:31:39 -0800 Subject: [PATCH 1/2] test: only build curFileLimit when testing --- nofile_posix.go => nofile_test_posix.go | 0 nofile_windows.go => nofile_test_windows.go | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename nofile_posix.go => nofile_test_posix.go (100%) rename nofile_windows.go => nofile_test_windows.go (100%) diff --git a/nofile_posix.go b/nofile_test_posix.go similarity index 100% rename from nofile_posix.go rename to nofile_test_posix.go diff --git a/nofile_windows.go b/nofile_test_windows.go similarity index 100% rename from nofile_windows.go rename to nofile_test_windows.go From da7209a6532a328e9f725142d30668ce040ca867 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 7 Feb 2019 17:33:57 -0800 Subject: [PATCH 2/2] test: fix tests on freebsd --- nofile_test_posix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nofile_test_posix.go b/nofile_test_posix.go index 1b07e318f..11ad5583f 100644 --- a/nofile_test_posix.go +++ b/nofile_test_posix.go @@ -7,5 +7,6 @@ import "syscall" func curFileLimit() uint64 { var n syscall.Rlimit syscall.Getrlimit(syscall.RLIMIT_NOFILE, &n) - return n.Cur + // cast because some platforms use int64 (e.g., freebsd) + return uint64(n.Cur) }