Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 752 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 752 Bytes

empty GoDoc

import "github.com/elivlo/empty"

empty is a library to only supports marshalling empty lists with square brackets instead of null. This type won't be needed for communication between Go services but helps a lot with Pydantic in Python. There is no need for declaring a type in python as Optional with this package.

Interfaces

  • All types also implement json.Marshaler and json.Unmarshaler, so you can marshal them to their native JSON representation.

empty.List[T]

Represents a slice of type T.

It marshals an empty list to brackets [] instead of null but unmarshalls like a normal slice.

License

MIT