From 11259a2be8ab23fbcafe71c6e7cb381f9f8e94ad Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Fri, 3 Mar 2023 18:38:47 -0800 Subject: [PATCH] add godoc for NumFD() (#6) --- num_fd.go | 2 ++ scli.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/num_fd.go b/num_fd.go index 9806802..ebe98bb 100644 --- a/num_fd.go +++ b/num_fd.go @@ -43,6 +43,8 @@ func countDir(dir string) int { return len(names) - 1 // for the dir we just opened } +// NumFD returns the number of open file descriptors (or -1 on error). +// On windows it returns the number of handles. func NumFD() int { switch runtime.GOOS { case "windows": diff --git a/scli.go b/scli.go index e57e999..947f1c3 100644 --- a/scli.go +++ b/scli.go @@ -9,6 +9,8 @@ // Configure using the [cli] package variables (at minimum [MinArgs] unless your // binary only accepts flags), setup additional [flag] before calling // [ServerMain]. +// It also includes [NumFD] utility function to cross platform get the number +// of open file descriptors (handles on windows) held by your go process. package scli // import "fortio.org/scli" import (