refactor: yet another one, someday I might be happy

This commit is contained in:
2024-03-24 03:28:08 +00:00
parent ccc3668fa2
commit de3a9e55a8
18 changed files with 613 additions and 499 deletions

View File

@@ -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"}
}