title: Docker exec command from golang api
body: <p>Need help.I have code to exec command from docker container. Need corrently get stdout from exec command.</p>
  
  <pre><code>execConfig:= types.ExecConfig{Tty:false,AttachStdout:true,AttachStderr:false,Cmd:command}
      respIdExecCreate,err := cli.ContainerExecCreate(context.Background(),dockerName,execConfig)
      if err != nil {
          fmt.Println(err)
      }
      respId,err:=cli.ContainerExecAttach(context.Background(),respIdExecCreate.ID,types.ExecStartCheck{})
      if err != nil {
          fmt.Println(err)
      }
      scanner := bufio.NewScanner(respId.Reader)
      for scanner.Scan() {
         fmt.Println(output)
  }
  </code></pre>
  
  <p>From output i see interesting situation:
  <a href="https://gyazo.com/39933cf9306af36e7cf7b872044959ba" rel="noreferrer">Screen from gyazo</a></p>
  
  <p>How corrently remove bytes ?</p>
  
  <p>I send simply command := []string{"echo","-n", "hello word"}</p>