Skip to content

Commit

Permalink
add godoc for NumFD() (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly authored Mar 4, 2023
1 parent 31b1bd7 commit 11259a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions num_fd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 2 additions & 0 deletions scli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 11259a2

Please sign in to comment.