updated dependencies and go
This commit is contained in:
+20
-20
@@ -49,13 +49,13 @@ const (
|
||||
|
||||
type MetaValue struct {
|
||||
DataType metaDataType `json:"dataType"`
|
||||
Value interface{} `json:"value"`
|
||||
Value any `json:"value"`
|
||||
}
|
||||
|
||||
type metaValueSerialization struct {
|
||||
DataType metaDataType `bson:"dataType"`
|
||||
Value string `bson:"value"`
|
||||
Raw interface{} `bson:"raw"`
|
||||
Raw any `bson:"raw"`
|
||||
}
|
||||
|
||||
func (v MetaValue) SerializeValue() (string, error) {
|
||||
@@ -379,7 +379,7 @@ func (v *MetaValue) Deserialize(value string, datatype metaDataType) error {
|
||||
v.DataType = datatype
|
||||
return nil
|
||||
} else {
|
||||
v.Value = langext.Ptr(value[1:])
|
||||
v.Value = new(value[1:])
|
||||
v.DataType = datatype
|
||||
return nil
|
||||
}
|
||||
@@ -694,28 +694,28 @@ func (v MetaValue) rawValueForJson() any {
|
||||
}
|
||||
|
||||
func (mm MetaMap) FormatOneLine(singleMaxLen int) string {
|
||||
r := ""
|
||||
var r strings.Builder
|
||||
|
||||
i := 0
|
||||
for key, val := range mm {
|
||||
if i > 0 {
|
||||
r += ", "
|
||||
r.WriteString(", ")
|
||||
}
|
||||
|
||||
r += "\"" + key + "\""
|
||||
r += ": "
|
||||
r += "\"" + val.ShortString(singleMaxLen) + "\""
|
||||
r.WriteString("\"" + key + "\"")
|
||||
r.WriteString(": ")
|
||||
r.WriteString("\"" + val.ShortString(singleMaxLen) + "\"")
|
||||
|
||||
i++
|
||||
}
|
||||
|
||||
return r
|
||||
return r.String()
|
||||
}
|
||||
|
||||
func (mm MetaMap) FormatMultiLine(indentFront string, indentKeys string, maxLenValue int) string {
|
||||
r := ""
|
||||
var r strings.Builder
|
||||
|
||||
r += indentFront + "{" + "\n"
|
||||
r.WriteString(indentFront + "{" + "\n")
|
||||
for key, val := range mm {
|
||||
if key == "gin.body" {
|
||||
continue
|
||||
@@ -724,16 +724,16 @@ func (mm MetaMap) FormatMultiLine(indentFront string, indentKeys string, maxLenV
|
||||
continue
|
||||
}
|
||||
|
||||
r += indentFront
|
||||
r += indentKeys
|
||||
r += "\"" + key + "\""
|
||||
r += ": "
|
||||
r += "\"" + val.ShortString(maxLenValue) + "\""
|
||||
r += ",\n"
|
||||
r.WriteString(indentFront)
|
||||
r.WriteString(indentKeys)
|
||||
r.WriteString("\"" + key + "\"")
|
||||
r.WriteString(": ")
|
||||
r.WriteString("\"" + val.ShortString(maxLenValue) + "\"")
|
||||
r.WriteString(",\n")
|
||||
}
|
||||
r += indentFront + "}"
|
||||
r.WriteString(indentFront + "}")
|
||||
|
||||
return r
|
||||
return r.String()
|
||||
}
|
||||
|
||||
func (mm MetaMap) Any() bool {
|
||||
@@ -747,7 +747,7 @@ func (mm MetaMap) Apply(evt *zerolog.Event, limitLen *int) *zerolog.Event {
|
||||
return evt
|
||||
}
|
||||
|
||||
func (mm MetaMap) add(key string, mdtype metaDataType, val interface{}) {
|
||||
func (mm MetaMap) add(key string, mdtype metaDataType, val any) {
|
||||
if _, ok := mm[key]; !ok {
|
||||
mm[key] = MetaValue{DataType: mdtype, Value: val}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user