You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't a Go thing. This is your terminal rendering that. You probably meant \n anyway. You can confirm by piping into hexdump or hd that Go is writing them.
Sorry for the inconvenience and thank you for the awesome programming language!
ALTree
changed the title
fmt.Println: strings including \r are not printed correctly (darwin only?)
fmt: strings including \r are not printed correctly (darwin only?)
Feb 6, 2018
What version of Go are you using (
go version
)?go version go1.9.3 darwin/amd64
What environment are you using (
go env
)?go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8p/1rng6dl524z_7n11hnzj_gfr0000gn/T/go-build794680911=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
https://play.golang.org/p/o3pytsrv4K2
What did you expect to see?
[102 111 111 13 98 97 114 13 102 111 111 98 97 114]
14 14
foo
bar
foobar
Note: On play.golang.org it works just fine
What did you see instead?
On Mac the last print will swallow all lines except the last line. So I only see:
[102 111 111 13 98 97 114 13 102 111 111 98 97 114]
14 14
foobar
Works perfectly fine with \n, but not with \r.
The text was updated successfully, but these errors were encountered: