title: Golang bytes.Buffer - Passby value issue
body: <p>The below golang(go1.10.2) code will give an unexpected output</p>
  
  <pre><code>package main
  
  import (
      "bytes"
      "fmt"
  )
  
  func main() {
      var b bytes.Buffer
      //Commenting the below line will fix the problem
      b.WriteString("aas-")
      fmt.Printf("Before Calling - \"%s\"\n", b.String())
      b = makeMeMad(b)
      fmt.Printf("FinalValue - \"%s\"\n", b.String())
  }
  
  func makeMeMad(b bytes.Buffer) bytes.Buffer {
      b.WriteString("xcxxcx asdasdas dasdsd asdasdasdasd")
      fmt.Printf("Write More - \"%s\"\n", b.String())
  
      /*
          //This will fix the problem
          var newBuffer bytes.Buffer
          newBuffer.WriteString(b.String())
          return newBuffer
      */
      return b
  }
  </code></pre>
  
  <p>Output </p>
  
  <pre><code>Before Calling - "aas-"
  Write More - "aas-xcxxcx asdasdas dasdsd asdasdasdasd"
  FinalValue - "aas-                                   "
  </code></pre>
  
  <p>I was expecting "aas-xcxxcx asdasdas dasdsd asdasdasdasd" in the last line of output. Could anyone please explain.</p>