mirror of
https://github.com/jimeh/go-render.git
synced 2026-02-19 11:26:39 +00:00
refactor: yet another one, someday I might be happy
This commit is contained in:
@@ -14,7 +14,7 @@ var _ FormatRenderer = (*Binary)(nil)
|
||||
|
||||
// Render writes result of calling MarshalBinary() on v. If v does not implment
|
||||
// encoding.BinaryMarshaler the ErrCannotRander error will be returned.
|
||||
func (bm *Binary) Render(w io.Writer, v any) error {
|
||||
func (br *Binary) Render(w io.Writer, v any) error {
|
||||
x, ok := v.(encoding.BinaryMarshaler)
|
||||
if !ok {
|
||||
return fmt.Errorf("%w: %T", ErrCannotRender, v)
|
||||
@@ -32,3 +32,7 @@ func (bm *Binary) Render(w io.Writer, v any) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (br *Binary) Formats() []string {
|
||||
return []string{"binary", "bin"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user