pkg/rctl: fix fprintf statement

While at it, rename the file to have freebsd suffix instead of using
a go:build annotation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2025-03-29 23:27:30 -07:00
parent 1739b7170e
commit 061e1a17a9
1 changed files with 1 additions and 3 deletions

View File

@ -1,5 +1,3 @@
//go:build freebsd
package rctl
import (
@ -25,7 +23,7 @@ func GetRacct(filter string) (map[string]uint64, error) {
uintptr(unsafe.Pointer(&buf[0])),
uintptr(len(buf)), 0, 0)
if errno != 0 {
return nil, fmt.Errorf("error calling rctl_get_racct with filter %s: %v", errno)
return nil, fmt.Errorf("error calling rctl_get_racct with filter %s: %v", filter, errno)
}
len := bytes.IndexByte(buf[:], byte(0))
entries := strings.Split(string(buf[:len]), ",")