-
Notifications
You must be signed in to change notification settings - Fork 5
/
template.tmpl
33 lines (27 loc) · 1.03 KB
/
template.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Code generated by usestdlibvars, DO NOT EDIT.
package {{ .PackageName }}
import "fmt"
var (
{{- range $key, $data := .Dict.Data }}
_ = "{{ $data.Key }}" // want `"{{ quoteMeta $data.Key }}" can be replaced by {{ quoteMeta $data.Value }}`
{{- end }}
)
const (
{{- range $key, $data := .Dict.Data }}
_ = "{{ $data.Key }}" // want `"{{ quoteMeta $data.Key }}" can be replaced by {{ quoteMeta $data.Value }}`
{{- end }}
)
func _() {
{{- range $key, $data := .Dict.Data }}
_ = func(s string)string{return s}("{{ $data.Key }}") // want `"{{ quoteMeta $data.Key }}" can be replaced by {{ quoteMeta $data.Value }}`
_ = func(s string)string{return s}("text before key {{ $data.Key }}")
_ = func(s string)string{return s}("{{ $data.Key }} text after key")
{{- end }}
}
func _() {
{{- range $key, $data := .Dict.Data }}
_ = fmt.Sprint("{{ $data.Key }}") // want `"{{ quoteMeta $data.Key }}" can be replaced by {{ quoteMeta $data.Value }}`
_ = fmt.Sprint("text before key {{ $data.Key }}")
_ = fmt.Sprint("{{ $data.Key }} text after key")
{{- end }}
}