v0.0.542
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m9s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m9s
This commit is contained in:
@@ -10,6 +10,14 @@ type JsonOpt[T any] struct {
|
||||
value T
|
||||
}
|
||||
|
||||
func NewJsonOpt[T any](v T) JsonOpt[T] {
|
||||
return JsonOpt[T]{isSet: true, value: v}
|
||||
}
|
||||
|
||||
func EmptyJsonOpt[T any]() JsonOpt[T] {
|
||||
return JsonOpt[T]{isSet: false}
|
||||
}
|
||||
|
||||
// MarshalJSON returns m as the JSON encoding of m.
|
||||
func (m JsonOpt[T]) MarshalJSON() ([]byte, error) {
|
||||
if !m.isSet {
|
||||
|
Reference in New Issue
Block a user