diff --git a/encoder.go b/encoder.go index 9e8ea63..b348f61 100644 --- a/encoder.go +++ b/encoder.go @@ -4,8 +4,6 @@ import ( "fmt" "io" "sync" - - "gitea.olznet.de/OlzNet/slog" ) type Encoder struct { @@ -24,12 +22,6 @@ func (enc *Encoder) Encode(e interface{}) (err error) { if err != nil { return err } - if err = RegisterType(v.Interface()); err != nil { - return err - } - for _, t := range cacheTypes.ntypes { - slog.LOG_DEBUGFLN("t: %v", t) - } var b []byte if b, err = marshalVal(v.Interface()); err != nil { diff --git a/marshal.go b/marshal.go index 6ba93a6..294dcfc 100644 --- a/marshal.go +++ b/marshal.go @@ -371,6 +371,10 @@ func marshalType(e interface{}, ntype *NType) (ret []byte, err error) { } func marshalVal(e interface{}) (ret []byte, err error) { + if err = RegisterType(e); err != nil { + return ret, err + } + i, n, nl, err := indirectType(e) if err != nil { return ret, ErrValueInvalid