title: golang string.ToLower not working
body: <p>I have a simple input string which I need to read and count the repeated words.</p>
  
  <p>But, while doing that I need to convert the string to lower case, but some how the func ToLower is not working.</p>
  
  <p>I have attached the golang link, Please, help me understand what can be the issue. </p>
  
  <p><a href="https://play.golang.org/p/OnQW-pgQxqq" rel="nofollow noreferrer">https://play.golang.org/p/OnQW-pgQxqq</a></p>
  
  <p>Also pasting the code.</p>
  
  <pre><code>func main() {
      input := `
  one
  two Two
  three Three Three;
  four four four, four
  five? five. five, five Five`
      countwords(input)
  }
  
  type kv struct {
      key string
      val int
  }
  
  type kvlist []kv
  
  // need to define custome interface to make this work:
  func (kv kvlist) Less(i, j int) bool { return kv[i].val &lt; kv[j].val }
  func (kv kvlist) Swap(i, j int)      { kv[i], kv[j] = kv[j], kv[i] }
  func (kv kvlist) Len() int           { return len(kv) }
  
  //sort the words by value
  func sortmap(wordmap map[string]int) []kv {
      list := make(kvlist, len(wordmap))
      i := 0
      for k, v := range wordmap {
          list[i] = kv{k, v}
          i++
      }
      // we need to make few more modification to change this but,
      // for now lets assume it works.
      sort.Sort(sort.Reverse(list))
      return list
  }
  
  func countwords(str string) []kv {
      count := make(map[string]int)
      reg, err := regexp.Compile("[^a-zA-Z0-9 ]+")
      if err != nil {
          log.Fatal(err)
      }
      lines := strings.Split(str, "\n")
      for _, line := range lines {
          line := reg.ReplaceAllString(line, "")
          strings.ToLower(string(line))
          repeatwords := strings.Fields(line) // count the repeated words
          fmt.Println(repeatwords)
          for _, word := range repeatwords {
              if _, ok := count[word]; ok {
                  count[word]++
              } else {
                  count[word] = 1
              }
          }
      }
      //once counted now sort the map based on values(repeated words).
      ret := sortmap(count)
      fmt.Println(count)
      return ret
  }
  </code></pre>