Skip to content

Commit 3da366f

Browse files
committed
Rename example functions so they actually show up
1 parent fa89a44 commit 3da366f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/templatelib/lib_example_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/docker-library/go-dockerlibrary/pkg/templatelib"
88
)
99

10-
func Example_FuncMapPrefixSuffix() {
10+
func Example_prefixSuffix() {
1111
tmpl, err := template.New("github-or-html").Funcs(templatelib.FuncMap).Parse(`
1212
{{- . -}}
1313
@@ -52,7 +52,7 @@ func Example_FuncMapPrefixSuffix() {
5252
// https://github.com/example/example/raw/master/test.html GitHub HTML
5353
}
5454

55-
func Example_FuncMapTernary() {
55+
func Example_ternary() {
5656
tmpl, err := template.New("huge-if-true").Funcs(templatelib.FuncMap).Parse(`
5757
{{- range $a := . -}}
5858
{{ printf "%#v: %s\n" $a (ternary "HUGE" "not so huge" $a) }}
@@ -90,7 +90,7 @@ func Example_FuncMapTernary() {
9090
// []bool{false}: HUGE
9191
}
9292

93-
func Example_FuncMapFirstLast() {
93+
func Example_firstLast() {
9494
tmpl, err := template.New("first-and-last").Funcs(templatelib.FuncMap).Parse(`First: {{ . | first }}, Last: {{ . | last }}`)
9595

9696
err = tmpl.Execute(os.Stdout, []interface{}{
@@ -106,7 +106,7 @@ func Example_FuncMapFirstLast() {
106106
// First: a, Last: c
107107
}
108108

109-
func Example_FuncMapJson() {
109+
func Example_json() {
110110
tmpl, err := template.New("json").Funcs(templatelib.FuncMap).Parse(`
111111
{{- json . -}}
112112
`)
@@ -124,7 +124,7 @@ func Example_FuncMapJson() {
124124
// {"a":["1","2","3"],"b":{"1":true,"2":false,"3":true},"c":null}
125125
}
126126

127-
func Example_FuncMapJoin() {
127+
func Example_join() {
128128
tmpl, err := template.New("join").Funcs(templatelib.FuncMap).Parse(`
129129
Array: {{ . | join ", " }}{{ "\n" -}}
130130
Args: {{ join ", " "a" "b" "c" -}}
@@ -144,7 +144,7 @@ func Example_FuncMapJoin() {
144144
// Args: a, b, c
145145
}
146146

147-
func Example_FuncMapTrimReplaceGitToHttps() {
147+
func Example_trimReplaceGitToHttps() {
148148
tmpl, err := template.New("git-to-https").Funcs(templatelib.FuncMap).Parse(`
149149
{{- range . -}}
150150
{{- . | replace "git://" "https://" | trimSuffixes ".git" }}{{ "\n" -}}
@@ -166,7 +166,7 @@ func Example_FuncMapTrimReplaceGitToHttps() {
166166
// https://github.com/jsmith/some-repo
167167
}
168168

169-
func Example_FuncMapTrimReplaceGitToGo() {
169+
func Example_trimReplaceGitToGo() {
170170
tmpl, err := template.New("git-to-go").Funcs(templatelib.FuncMap).Parse(`
171171
{{- range . -}}
172172
{{- . | trimPrefixes "git://" "http://" "https://" "ssh://" | trimSuffixes ".git" }}{{ "\n" -}}

0 commit comments

Comments
 (0)