Files
bzzz/vendor/github.com/elastic/gosigar/sigar_util.go
anthonyrawlins 5978a0b8f5 WIP: Save agent roles integration work before CHORUS rebrand
- Agent roles and coordination features
- Chat API integration testing
- New configuration and workspace management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 02:21:11 +10:00

31 lines
662 B
Go

// Copyright (c) 2012 VMware, Inc.
package gosigar
import (
"bytes"
)
// byteListToString converts the raw byte arrays we get into a string. This is a bit of a process, as byte strings are normally []uint8
func byteListToString(raw []int8) string {
byteList := make([]byte, len(raw))
for pos, singleByte := range raw {
byteList[pos] = byte(singleByte)
if singleByte == 0 {
break
}
}
return string(bytes.Trim(byteList, "\x00"))
}
func chop(buf []byte) []byte {
return buf[0 : len(buf)-1]
}
// convertBytesToString trims null bytes and returns a string
func convertBytesToString(arr []byte) string {
return string(bytes.Trim(arr, "\x00"))
}