Compare commits

..

2 Commits

Author SHA1 Message Date
alu 05519694e1 add vmid to instance 2026-07-07 16:42:07 +00:00
alu 78e6de32d7 add uint to uint64 for SafeUint64 2026-07-07 03:36:32 +00:00
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -21,6 +21,7 @@ const VM InstanceType = "VM"
const CT InstanceType = "CT"
type Instance struct {
VMID InstanceID `json:"vmid" mapstructure:"vmid"`
Type InstanceType `json:"type" mapstructure:"type"`
Name string `json:"name" mapstructure:"name"`
Proctype string `json:"cpu" mapstructure:"cpu"`
+1 -1
View File
@@ -48,7 +48,7 @@ func FormatNumber(val uint64, base uint64) (string, string) {
}
// Converts int, int32, and int64 to uint64. Less than 0 check.
func SafeUint64[I int | int32 | int64](i I) uint64 {
func SafeUint64[I int | int32 | int64 | uint | uint32](i I) uint64 {
if i < 0 {
log.Printf("Tried to cast %d to uint64", i)
return 0