title: Convert String to Function name in GO?
body: <p>I am creating a Restful API.</p>
  
  <p>I am passing function name and arguments in JSON</p>
  
  <p>eg. <code>"localhost/json_server?method=foo&amp;id=1"</code></p>
  
  <p>Lets say, i have a simple go server running</p>
  
  <pre><code> http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {                                                                             
       fmt.Println("path",r.URL.Path )                                                                                                             
       fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))                                                                                  
   }) 
  .........
  function json_server(){
  ....
  }
  </code></pre>
  
  <p>The <code>r.url.Path</code> will give me "<em><code>json_server</code></em>" in <strong>string</strong>. Now i want to first check if the function exists , if exists call the function as defined else throw some exception.</p>
  
  <p>Is this possible to do ?</p>
  
  <p>When i am doing <strong>python</strong> and  i use <code>getattr(method,args)</code> to call the method and arguments which are in string. </p>
  
  <p>I have developed interest in Go after using Docker. Any help will be appreciated.</p>