v0.0.431
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m10s

This commit is contained in:
Mike Schwörer 2024-04-10 15:29:59 +02:00
parent 6602f86b43
commit 2e713c808d
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
2 changed files with 26 additions and 2 deletions

View File

@ -1,5 +1,5 @@
package goext 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"

View File

@ -87,3 +87,27 @@ func MarshalJsonOrNil(v any) *string {
} }
return Ptr(string(bin)) 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))
}