title: String split in golang
body: <p>I have two arguments name and value, that I am trying to parse at runtime.</p>
  
  <p>At run time I am passing the following values:</p>
  
  <pre><code>name = text,text,text,text,text
  value = 0 ,285,404,6,24
  </code></pre>
  
  <p>Currently the output is as following;</p>
  
  <pre><code>Parameters: {"text,text,text,text,text":"0,285,404,6,24"}
  </code></pre>
  
  <p>when actually it must display as,</p>
  
  <pre><code>Parameters: {"text":"0"}
  Parameters: {"text":"285"}
  Parameters: {"text":"404"}
  Parameters: {"text":"6"}
  Parameters: {"text":"24"}
  </code></pre>
  
  <p>Following is my code;</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
     var m string
     var matchField = []string{"index,index,index,index"}
     var matchValue =[]string{"29,4,87,54"}
  
     for i := 0 ; i &lt; 1 ; i++ {
          m = parameter(matchField[i], matchValue[i])
          fmt.Printf("Result: %s\n", m)
     }
  }
  
  
  func parameter(name string, value string) (matcher string) {
      var result string
      if name != "" || value != "" {
              result = fmt.Sprintf("{\"%s\":\"%s\"}", name, value)
      }
      return result
  }
  </code></pre>
  
  <p>I wanted to know how to display the output accurately.</p>