cosmetic change
parent
d4de6ca5ee
commit
8e60e8ea3e
|
@ -5,9 +5,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/reiver/go-json"
|
|
||||||
|
|
||||||
"github.com/reiver/go-erorr"
|
"github.com/reiver/go-erorr"
|
||||||
|
"github.com/reiver/go-json"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ json.Marshaler = Nothing[bool]()
|
var _ json.Marshaler = Nothing[bool]()
|
||||||
|
@ -15,7 +14,6 @@ var _ json.Marshaler = Nothing[string]()
|
||||||
|
|
||||||
// MarshalJSON makes it so json.Marshaler is implemented.
|
// MarshalJSON makes it so json.Marshaler is implemented.
|
||||||
func (receiver Optional[T]) MarshalJSON() ([]byte, error) {
|
func (receiver Optional[T]) MarshalJSON() ([]byte, error) {
|
||||||
|
|
||||||
switch interface{}(receiver.value).(type) {
|
switch interface{}(receiver.value).(type) {
|
||||||
case json.Marshaler, encoding.TextMarshaler, bool, int, int8, int16, int32, int64, string, uint, uint8, uint16, uint32, uint64:
|
case json.Marshaler, encoding.TextMarshaler, bool, int, int8, int16, int32, int64, string, uint, uint8, uint16, uint32, uint64:
|
||||||
// these are OK.
|
// these are OK.
|
||||||
|
|
Loading…
Reference in New Issue