v0.0.544
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m0s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m0s
This commit is contained in:
@@ -3,6 +3,7 @@ package dataext
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
)
|
||||
|
||||
type JsonOpt[T any] struct {
|
||||
@@ -59,6 +60,13 @@ func (m JsonOpt[T]) ValueOrNil() *T {
|
||||
return &m.value
|
||||
}
|
||||
|
||||
func (m JsonOpt[T]) ValueDblPtrOrNil() **T {
|
||||
if !m.isSet {
|
||||
return nil
|
||||
}
|
||||
return langext.DblPtr(m.value)
|
||||
}
|
||||
|
||||
func (m JsonOpt[T]) MustValue() T {
|
||||
if !m.isSet {
|
||||
panic("value not set")
|
||||
|
Reference in New Issue
Block a user