Skip to content

Commit

Permalink
codec: expose Handle.Name() via (En|De)coder, for general use (as nee…
Browse files Browse the repository at this point in the history
…ded)

Fixes #396
  • Loading branch information
ugorji committed Nov 28, 2023
1 parent 1acedc2 commit 48ba79b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions codec/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,10 @@ func NewDecoderString(s string, h Handle) *Decoder {
return NewDecoderBytes(bytesView(s), h)
}

func (d *Decoder) HandleName() string {
return d.hh.Name()
}

func (d *Decoder) r() *decRd {
return &d.decRd
}
Expand Down
4 changes: 4 additions & 0 deletions codec/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,10 @@ func NewEncoderBytes(out *[]byte, h Handle) *Encoder {
return e
}

func (e *Encoder) HandleName() string {
return e.hh.Name()
}

func (e *Encoder) init(h Handle) {
initHandle(h)
e.err = errEncoderNotInitialized
Expand Down

0 comments on commit 48ba79b

Please sign in to comment.