Answer the question
In order to leave comments, you need to log in
How to refer to struct field in golang html template?
Let's say there is a structure that I pass to the html template
type Mystruct struct{
Mas[]int
User User
}
type User struct {
Username string
Password string
Name string
Authenticated bool
}
{{if .Authenticated }}
<p>NO</p>
{{else}}
<p>YES</p>
{{end}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question