Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/pem: fix #bytes lineBreaker.Write returns #28914

Open
santhosh-tekuri opened this issue Nov 21, 2018 · 3 comments
Open

encoding/pem: fix #bytes lineBreaker.Write returns #28914

santhosh-tekuri opened this issue Nov 21, 2018 · 3 comments

Comments

@santhosh-tekuri
Copy link
Contributor

@santhosh-tekuri santhosh-tekuri commented Nov 21, 2018

What version of Go are you using (go version)?

$ go version
go version go1.11.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/santhosh/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/santhosh/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/xy/4qx1s2zn5qn82yzpx8xhbplr0000gn/T/go-build703305017=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

const sixtyFourCharString = "0123456789012345678901234567890123456789012345678901234567890123"
var breaker lineBreaker
breaker.out = new(bytes.Buffer)
n, err := breaker.Write([]byte(test.in))
fmt.Println(n,err)

What did you expect to see?

should print 64 nil

What did you see instead?

this prints 0 nil

as this api is not exported, it will not be visible to end user. but still the io.Writer contract is broken

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 21, 2018

Change https://golang.org/cl/150877 mentions this issue: encoding/pem: fix #bytes lineBreaker.Write returns

Loading

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Nov 21, 2018

Does this impact anything a user can see?

That is, can you show a https://play.golang.org/ snippet that's wrong today?

Loading

@santhosh-tekuri
Copy link
Contributor Author

@santhosh-tekuri santhosh-tekuri commented Nov 21, 2018

user cannot see its impact

Loading

@bradfitz bradfitz added this to the Unplanned milestone Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants