Excited to find a dedicated Golang forum. I am new to Go coming from a Javascript background.
I am trying to read the url parameter values to use in a function.
func handler(w http.ResponseWriter, r *http.Request) {
cycleParam := r.URL.Query().Get("cycles")
if len(cycleParam) != 0 {
io.WriteString(w, cycleParam)
}
calculateSolution(w, cycleParam)
}
//lissajous function
func calculateSolution(out io.Writer, cycleParam String) {
the second parameter of the last line is returning a compiler error.
github.com/kielan/project/main.go:67: undefined: String
I tried other types and got the same result. Am I making a syntactic error or is there more to it? I find the error solution unhelpful, I can’t figure out why the param is undefined at compile time.
thanks for taking the time to help me out