使用GO和Martini提交表单

I'm very new in GO and martini package. What im trying to do now to to submit a form using AJAX. The problem is that go returns the whole html file. I don't know if there are errors since there no errors return. I need to test if my form is successfully submitting the data for I will use it for sending a POST data to an API. for now just need to know if my form is passing the data successfully.

I have this code.

GO code:

type UserSignup struct {
    Email string `form: "email"`
}

func signup_user(email string) UserSignup {
    return UserSignup {
        Email : email
    } 
}

AJAX call:

$.ajax({
    url: '/signup',
    type: 'POST',
    success: function(data) {
                 console.log(data);
             },
    error: function(result) {
                 //general div to handle error messages
                 console.log(result.responseText);
             }
    });

MTPL code:

<form class="form-signup" action="/signup">
    <input type="text" value="Email" name="email" class="signup-email" id="signup-email" onClick="this.setSelectionRange(0, this.value.length)">
    <input type="submit" value="Go" id="signup-go">
</form>

Thanks.

Form values actually come from http.Request, they aren't passed into the handler unless you're using Binding.

Using request:

func signup_user(r *http.Request) {

   email := r.FormValue("email")

   return email

}

Using martini binding:

func signup_user(us UserSignup, r *http.Request) {

   email := us.Email

   return email

}