Add pk.Option API

This commit is contained in:
Tnze
2022-12-06 02:14:38 +08:00
parent 516b3c2a8b
commit 55bf5eddbb
6 changed files with 107 additions and 50 deletions

View File

@ -11,6 +11,7 @@
package chat
import (
"bytes"
"encoding/json"
"errors"
"fmt"
@ -113,6 +114,7 @@ func (m Message) MarshalJSON() ([]byte, error) {
// UnmarshalJSON decode json to Message
func (m *Message) UnmarshalJSON(raw []byte) (err error) {
raw = bytes.TrimSpace(raw)
if len(raw) == 0 {
return io.EOF
}