The issue here appears to be syntax, this is day 3 of coding in Go for me. The for loop give me the red underline under for and the message says: "expected declaration found, 'for'"
Can someone explain to me why and/or where I went wrong?
func getAllWithTag(w http.ResponseWriter, r *http.Requests) {
fmt.Println("Results with tag: *Tags)
}
var params = mux.Vars(r)
for _, tag := range tags {
if *Tags == nil {
Jason.NewEncoder(w).Encode("error: The tag parameter is required")
}
}
In short I am trying to make the tags a required field when searching but that part isn't important til I resolve this error.
for. Please include that. - Hymns For Discofmt.Println("Results with tag: *Tags)seems a double quote was missing - user338371