mirror of
https://github.com/nabbar/golib.git
synced 2026-04-22 23:17:12 +08:00
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:
@@ -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": []
|
||||
}
|
||||
]
|
||||
}`)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user