title: Passing string argument in golang
body: <p>just starting with Go and having trouble with basic function call:</p>
  
  <pre><code>fileContentBytes := ioutil.ReadFile("serverList.txt")
  fileContent := string(fileContentBytes)
  serverList := strings.Split(fileContent,"\n")
     /*
  serverList:
  server1,
  server2,
  server3
     */
  for _,server := range serverList {
     fmt.Println("sending ", server)
     processServer(server)
  }
  
  func processServer(s string) {
     fmt.Println(s, " : started processing")
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>sending server1
   : started processing
  sending server2
   : started processing
  sending server3
   server3: started processing
  </code></pre>
  
  <p>In the above code from the for loop I am able to print all the elements of array but <em>only the last element</em> gets passed properly to the function <code>processServer</code>.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Go Version: 1.8
  OS: Windows 7 x64</p>