Assisted-by: DeepSeek V4.1 Flash
This commit is contained in:
@@ -86,6 +86,15 @@ func (e *encoder) encode(v any) error {
|
||||
if err := e.checkCtx(); err != nil {
|
||||
return err
|
||||
}
|
||||
switch x := v.(type) {
|
||||
case *Document:
|
||||
if x == nil {
|
||||
return fmt.Errorf("interpres: cannot marshal nil value")
|
||||
}
|
||||
return fmt.Errorf("interpres: cannot marshal a Document; marshal its Map() to write the values")
|
||||
case Document:
|
||||
return fmt.Errorf("interpres: cannot marshal a Document; marshal its Map() to write the values")
|
||||
}
|
||||
rv := reflect.ValueOf(v)
|
||||
if !rv.IsValid() {
|
||||
return fmt.Errorf("interpres: cannot marshal nil value")
|
||||
|
||||
Reference in New Issue
Block a user