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
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@santhosh-tekuri
Copy link
Contributor

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
Contributor

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

@bradfitz
Copy link
Contributor

Does this impact anything a user can see?

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

@santhosh-tekuri
Copy link
Contributor Author

user cannot see its impact

@bradfitz bradfitz added this to the Unplanned milestone Nov 21, 2018
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants