add go lang add/minus functions and give better example

This commit is contained in:
Maidul Islam
2024-04-18 15:45:20 -04:00
parent 2aea73861b
commit 581ffc613c
3 changed files with 22 additions and 12 deletions

View File

@@ -381,6 +381,12 @@ func ProcessTemplate(templateId int, templatePath string, data interface{}, acce
funcs := template.FuncMap{
"secret": secretFunction,
"dynamic_secret": dynamicSecretFunction,
"minus": func(a, b int) int {
return a - b
},
"add": func(a, b int) int {
return a + b
},
}
templateName := path.Base(templatePath)

View File

@@ -171,7 +171,7 @@ func init() {
exportCmd.Flags().StringP("tags", "t", "", "filter secrets by tag slugs")
exportCmd.Flags().String("projectId", "", "manually set the projectId to fetch secrets from")
exportCmd.Flags().String("path", "/", "get secrets within a folder path")
exportCmd.Flags().String("template", "", "The path to the template file to output secrets")
exportCmd.Flags().String("template", "", "The path to the template file used to render secrets")
}
// Format according to the format flag