🐛 Only trim bang on out
This commit is contained in:
parent
a8cbfd087f
commit
0b2e178066
4 changed files with 20 additions and 5 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
@ -27,6 +28,9 @@ func WriteValue(buff *bytes.Buffer, val any) (n int, err error) {
|
|||
return buff.Write(o)
|
||||
}
|
||||
case string:
|
||||
if strings.HasPrefix(v, "!") {
|
||||
return buff.WriteString(strings.TrimPrefix(v, "!"))
|
||||
}
|
||||
return buff.WriteString(v)
|
||||
case int:
|
||||
return buff.WriteString(strconv.Itoa(v))
|
||||
|
|
@ -39,6 +43,9 @@ func WriteValue(buff *bytes.Buffer, val any) (n int, err error) {
|
|||
case json.RawMessage:
|
||||
return buff.Write(v)
|
||||
case []byte:
|
||||
if v[0] == '!' {
|
||||
return buff.Write(v[1:])
|
||||
}
|
||||
return buff.Write(v)
|
||||
case byte:
|
||||
err = buff.WriteByte(v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue