fix: removed json functions since they're covered by Sprig lib

This commit is contained in:
Daniel Hougaard
2025-03-29 04:45:19 +04:00
parent 3ad50a4386
commit 438e2dfa07
2 changed files with 0 additions and 36 deletions

View File

@ -1,32 +0,0 @@
package template
import (
"encoding/json"
"fmt"
)
func fromJSON(in []byte) any {
var out any
err := json.Unmarshal(in, &out)
if err != nil {
panic(fmt.Sprintf(errUnmarshalJSON, err))
}
return out
}
func toJSON(in any) string {
output, err := json.Marshal(in)
if err != nil {
panic(fmt.Sprintf(errMarshalJSON, err))
}
return string(output)
}
func jsonStringToJSON(in string) any {
var out any
err := json.Unmarshal([]byte(in), &out)
if err != nil {
panic(fmt.Sprintf(errUnmarshalJSON, err))
}
return out
}

View File

@ -30,10 +30,6 @@ var customInfisicalSecretTemplateFunctions = tpl.FuncMap{
"decodeBase64ToBytes": decodeBase64ToBytes,
"encodeBase64": encodeBase64,
"fromJson": fromJSON,
"fromJsonStringToJson": jsonStringToJSON,
"toJson": toJSON,
}
const (