title: How to move html data to struct in Golang
body: <p>I'm new to Golang and I am trying to move data from an action field to a struct.</p>
  
  <p>My func main is:</p>
  
  <pre><code>func main () {
      http.HandleFunc("/public/", func (w http.ResponseWriter, r *http.Request) {
          http.ServeFile(w, r, r.URL.Path[1:]) })
      http.HandleFunc("/public/new_user/", signup) 
      http.ListenAndServe(":8080", nil)
  }
  
  
  // struct for recieving Signup data input from signup.html
  type Signup struct {
      name  string
      email string
  }
  
  // func to receive data into struc above FROM signup.html
  func signup(w http.ResponseWriter, r *http.Request) {
      var S Signup 
  
      S.name = r.FormValue("name")
      S.email = r.FormValue("email")
  
      //this is just to test the output
      fmt.Println("%v\n", S.name)
      fmt.Println("%v\n", S.email)
  }
  </code></pre>
  
  <p>I have <code>http.HandleFunc("public/new_user/", signup)</code> which should render the <code>signup</code> function.  However, I am receiving a BLANK html page when I route to <code>public/new_user</code> instead of receiving the struct from func signup.</p>
  
  <p>The <code>S.name = r.FormValue("name")</code> and <code>S.email = r.FormValue("email")</code> lines ABOVE are getting their info from the signup page which is:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Sign Up&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;h1&gt;Sign Up&lt;/h1&gt;
  &lt;br/&gt;
  
  &lt;form action="/public/new_user" method="post" id="form1"&gt;
  
  &lt;label&gt;Name:&lt;/label&gt;
  &lt;input type="string" name="name" /&gt;
  &lt;/br&gt;
  &lt;/br&gt;
  &lt;label&gt;Email:&lt;/label&gt;
  &lt;input type="string" name="email" /&gt;
  &lt;/form&gt;
  
  &lt;/br&gt;
  
  &lt;button type="submit" form="form1" value="Submit"&gt;Submit&lt;/button&gt;
  
  &lt;/body&gt;
  
  &lt;!-- Latest compiled and minified CSS --&gt;
  &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
  
  &lt;!-- jQuery library --&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;!-- Latest compiled JavaScript --&gt;
  &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>As you can see, this page routes to <code>public/new_user</code> upon submit.  Can anyone please tell me why <code>public/new_user</code> is blank seeing as how I have <code>public/new_user</code> in:</p>
  
  <pre><code>http.HandleFunc("/public/new_user/", signup) 
  </code></pre>
  
  <p>Which should render the signup function? Thanks</p>