Package Status:

- FIX potential overflow uint8->int8 in control sub package

Package Config:
- UPDATE component status to include info metadata

Other:
- BUMP dependencies
This commit is contained in:
Nicolas JUHEL
2026-03-17 17:32:52 +01:00
parent 7b59ce5f50
commit 9aac46b522
3 changed files with 11 additions and 3 deletions
+4 -1
View File
@@ -38,6 +38,9 @@ var _defaultConfig = []byte(`{
"Warn": 207,
"KO": 500
},
"info": {
"doc": "http://example.com"
},
"component": [
{
"mode": "Must",
@@ -45,7 +48,7 @@ var _defaultConfig = []byte(`{
"component1",
"component2"
],
"configKeys": []
"configKeys": []
}
]
}`)
+1 -1
View File
@@ -34,7 +34,7 @@ require (
github.com/mattn/go-colorable v0.1.14
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/nats-io/jwt/v2 v2.8.0
github.com/nats-io/jwt/v2 v2.8.1
github.com/nats-io/nats-server/v2 v2.12.5
github.com/nats-io/nats.go v1.49.0
github.com/onsi/ginkgo/v2 v2.28.1
+6 -1
View File
@@ -27,6 +27,7 @@
package control
import (
"math"
"reflect"
"strings"
@@ -97,7 +98,11 @@ func (c Mode) Uint64() uint64 {
// Currently, this implementation returns 0 (Ignore) for safety or compatibility reasons.
// Developers should check if this specific behavior meets their needs.
func (c Mode) Int8() int8 {
return int8(c)
if i := c.Uint8(); i > 0 && i < math.MaxInt8 {
return int8(i)
}
return 0
}
// Int16 returns the `Mode` value as an `int16`.