Undefined parameter, no feedback from compiler

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 :smirk:

There is also https://groups.google.com/forum/#!forum/golang-nuts

it should be “string”, not “String”. It is saying on like 67, “String” is undefined. Just a typo.

In the future I might recommend posting snippets like this if possible http://play.golang.org/

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.