Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Fix decoding to []interface{} #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func Copy(w Sender, r Receiver) (int, error) {
var n int
for {
m := make(map[string]interface{})
var m interface{}
err := r.Receive(&m)
if err != nil {
if err == io.EOF {
Expand Down
3 changes: 2 additions & 1 deletion inmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func (w *pipeSender) copyMessage(message interface{}) (interface{}, error) {
if mapOk {
return w.copyChannelMessage(mapCopy)
}
return w.copyStructure(message)
return w.copyValue(message)
}

func (w *pipeSender) copyValue(v interface{}) (interface{}, error) {
Expand Down Expand Up @@ -418,6 +418,7 @@ func (w *pipeSender) copyChannelInterfaceMessage(m map[interface{}]interface{})

return mCopy, nil
}

func (w *pipeSender) copyStructure(m interface{}) (interface{}, error) {
v := reflect.ValueOf(m)
if v.Kind() == reflect.Ptr {
Expand Down