mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 02:26:40 +00:00
fix: removed json functions since they're covered by Sprig lib
This commit is contained in:
@@ -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
|
|
||||||
}
|
|
||||||
@@ -30,10 +30,6 @@ var customInfisicalSecretTemplateFunctions = tpl.FuncMap{
|
|||||||
|
|
||||||
"decodeBase64ToBytes": decodeBase64ToBytes,
|
"decodeBase64ToBytes": decodeBase64ToBytes,
|
||||||
"encodeBase64": encodeBase64,
|
"encodeBase64": encodeBase64,
|
||||||
|
|
||||||
"fromJson": fromJSON,
|
|
||||||
"fromJsonStringToJson": jsonStringToJSON,
|
|
||||||
"toJson": toJSON,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
Reference in New Issue
Block a user