mirror of https://github.com/open-feature/cli.git
remove unused template values
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
This commit is contained in:
parent
12cd2cb408
commit
08b9185a1e
|
|
@ -2,7 +2,6 @@ package react
|
|||
|
||||
import (
|
||||
_ "embed"
|
||||
"sort"
|
||||
"strconv"
|
||||
"text/template"
|
||||
|
||||
|
|
@ -48,23 +47,6 @@ func flagInitParam(flagName string) string {
|
|||
return strconv.Quote(flagName)
|
||||
}
|
||||
|
||||
func flagAccessFunc(t types.FlagType) string {
|
||||
return "useFlag"
|
||||
}
|
||||
|
||||
func supportImports(flags []*types.FlagTmplData) []string {
|
||||
imports := make(map[string]struct{})
|
||||
for _, flag := range flags {
|
||||
imports[flagAccessFunc(flag.Type)] = struct{}{}
|
||||
}
|
||||
var result []string
|
||||
for k := range imports {
|
||||
result = append(result, k)
|
||||
}
|
||||
sort.Strings(result)
|
||||
return result
|
||||
}
|
||||
|
||||
func defaultValueLiteral(flag *types.FlagTmplData) string {
|
||||
switch flag.Type {
|
||||
case types.StringType:
|
||||
|
|
@ -91,8 +73,6 @@ func (g *genImpl) Generate(input types.Input) error {
|
|||
funcs := template.FuncMap{
|
||||
"FlagVarName": flagVarName,
|
||||
"FlagInitParam": flagInitParam,
|
||||
"FlagAccessFunc": flagAccessFunc,
|
||||
"SupportImports": supportImports,
|
||||
"DefaultValueLiteral": defaultValueLiteral,
|
||||
"TypeString": typeString,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue