diff --git a/dataext/optional.go b/dataext/optional.go index 1f33ab4..b0af247 100644 --- a/dataext/optional.go +++ b/dataext/optional.go @@ -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 { diff --git a/goextVersion.go b/goextVersion.go index ddee908..e9acaa5 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.541" +const GoextVersion = "0.0.542" -const GoextVersionTimestamp = "2024-11-05T14:38:42+0100" +const GoextVersionTimestamp = "2024-11-07T13:13:12+0100"