You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i want to create a custom template so simple template to return the output result in addition of the pass faill tests result ,
i create a simple_template.go and put it in the directory templates but when i run i got some weird messages , i didn't find any place to find a tutorial to help me to create my template,
{{ define "Test" }}
func Test_{{ .Name }}(t *testing.T) {
type args struct {
{{- range .Fields }}
{{ .Name }} {{ .Type }}
{{- end }}
}
tests := []struct {
name string
args args
want {{ .ResultType }}
}{
// TODO: Add test cases here.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := {{ .Name }}({{ range $index, $element := .Fields }}{{ if $index }}, {{ end }}tt.args.{{ $element.Name }}{{ end }})
if got != tt.want {
t.Errorf("{{ .Name }}() got = %v, want %v", got, tt.want)
}
})
}
}
{{ end }}
root@07598207c071:/home# ls templates/
templates.go
root@07598207c071:/home# gotests -w -only combineIntegerArrays -template_dir /home/templates/ .
output.Process: render.Header: template: no template "header" associated with template "render"
is there any solution to apply .
thanks in advance
The text was updated successfully, but these errors were encountered:
hello hope you doing well,
i want to create a custom template so simple template to return the output result in addition of the pass faill tests result ,
i create a simple_template.go and put it in the directory templates but when i run i got some weird messages , i didn't find any place to find a tutorial to help me to create my template,
root@07598207c071:/home# ls templates/
templates.go
root@07598207c071:/home# gotests -w -only combineIntegerArrays -template_dir /home/templates/ .
output.Process: render.Header: template: no template "header" associated with template "render"
is there any solution to apply .
thanks in advance
The text was updated successfully, but these errors were encountered: