整理打印
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package template
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
@@ -18,6 +19,16 @@ var DefaultFuncMap = template.FuncMap{
|
||||
splits := strings.Split(str, "/")
|
||||
return splits[len(splits)-1]
|
||||
},
|
||||
"exports": func(port []any) string {
|
||||
var out []string
|
||||
for _, p := range port {
|
||||
p2 := p.(map[string]interface{})
|
||||
splits := strings.Split(p2["Cmd"].(string), "/")
|
||||
funcName := splits[len(splits)-1]
|
||||
out = append(out, fmt.Sprintf("%s/5", funcName))
|
||||
}
|
||||
return strings.Join(out, ",")
|
||||
},
|
||||
}
|
||||
|
||||
func hd(str []string) string {
|
||||
|
||||
Reference in New Issue
Block a user