v0.0.431
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m10s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m10s
This commit is contained in:
parent
6602f86b43
commit
2e713c808d
@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.430"
|
||||
const GoextVersion = "0.0.431"
|
||||
|
||||
const GoextVersionTimestamp = "2024-04-10T15:27:41+0200"
|
||||
const GoextVersionTimestamp = "2024-04-10T15:29:58+0200"
|
||||
|
@ -87,3 +87,27 @@ func MarshalJsonOrNil(v any) *string {
|
||||
}
|
||||
return Ptr(string(bin))
|
||||
}
|
||||
|
||||
func MarshalJsonIndentOrPanic(v any, prefix, indent string) string {
|
||||
bin, err := json.MarshalIndent(v, prefix, indent)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return string(bin)
|
||||
}
|
||||
|
||||
func MarshalJsonIndentOrDefault(v any, prefix, indent string, def string) string {
|
||||
bin, err := json.MarshalIndent(v, prefix, indent)
|
||||
if err != nil {
|
||||
return def
|
||||
}
|
||||
return string(bin)
|
||||
}
|
||||
|
||||
func MarshalJsonIndentOrNil(v any, prefix, indent string) *string {
|
||||
bin, err := json.MarshalIndent(v, prefix, indent)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return Ptr(string(bin))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user