title: Passing JSON parameter to function in GOLANG
body: <p>I want to pass a JSON object to a function in GOLANG ,so how would I define my parameters,would it be fine if I can define my params as string .below is a sample </p>
  
  <pre><code>    func getDetailedNameSpace(authentication string,id string) string{
   var jsonStr = []byte(string);
  tr := &amp;http.Transport{
          TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},
      }
  
      client := &amp;http.Client{Transport: tr}
  
      req, _ := http.NewRequest("PUT", "https://"+authentication.endPoint+"/object/namespaces/"+id, bytes.NewBuffer(jsonStr))
      req.Header.Add("X-Sds-Auth-Token",authentication.authtoken)
      req.Header.Add("Accept","application/json")
      res,err:=client.Do(req)
  
      body, err := ioutil.ReadAll(res.Body)
  
      if err!=nil{
      fmt.Printf("%s",err)
  
      }
      return string(body);
  
  
  }
  </code></pre>
  
  <p>Also i have to validate the params ,as in python we can have like below </p>
  
  <pre><code> def getDetailedNameSpace(authentication,id=None):
         assert authentication!=None,"Authentication Required"
  </code></pre>