如何从请求对象获取提交值

I am trying to make a form POST request with two different submit buttons. I would like to try and get the submit button value in go. How do I go about getting this from the http.Request object.

HTML Code:

<form action="/save" method="POST">
<div><span>Title: </span><textarea name="title" placeholder="Link">{{printf "%s" .Title}}</textarea></div>
<div>
    <button type="submit" value="submit1">1</button>
    <button type="submit" value="submit2">2</button>
</div>
</form>

GO Code:

func saveHandler(w http.ResponseWriter, r *http.Request) {
... How do I get the submit value
title := r.FormValue("title")
fmt.Println(title)
}
func main() {
    http.HandleFunc("/", viewHandler)
    http.HandleFunc("/save", saveHandler)
    http.ListenAndServe(":8080", nil)
}

Or do I need to do some Ajax trick where i have a hidden field and set it in ajax before the submit?

Give your buttons a name attribute and then you can differentiate between them.

HTML:

<form action="/save" method="POST">
<div><span>Title: </span><textarea name="title" placeholder="Link">{{printf "%s" .Title}}</textarea></div>
<div>
    <button type="submit" value="submit1" name="submit">1</button>
    <button type="submit" value="submit2" name="submit">2</button>
</div>
</form>

Go:

submit := r.FormValue("submit")  // will be "submit1" or "submit2"