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

image/gif: typo in type blockReader struct docs #46967

Closed
hiroakis opened this issue Jun 29, 2021 · 8 comments
Closed

image/gif: typo in type blockReader struct docs #46967

hiroakis opened this issue Jun 29, 2021 · 8 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@hiroakis
Copy link

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

$ go version
go version go1.16 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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/sano/Library/Caches/go-build"
GOENV="/Users/sano/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/sano/work/golang/1.15/cache2"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/sano/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/local/Cellar/go/1.16/libexec"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8n/zq1f67bx6z733nj8f0s2w10c0000gr/T/go-build3640241653=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Read the source code at github.com/golang/go/src/image/gif/reader.go

What did you expect to see?

// blockReader parses the block structure of GIF image data, which comprises
// (n, (n bytes)) blocks, with 1 <= n <= 255. It is the reader given to the
// LZW decoder, which is thus immune to the blocking. After the LZW decoder
// completes, there will be a 0-byte block remaining (0, ()), which is
// consumed when checking that the blockReader is exhausted.
//
// To avoid the allocation of a bufio.Reader for the lzw Reader, blockReader
// implements io.ReadByte and buffers blocks into the decoder's "tmp" buffer.

What did you see instead?

// blockReader parses the block structure of GIF image data, which comprises
// (n, (n bytes)) blocks, with 1 <= n <= 255. It is the reader given to the
// LZW decoder, which is thus immune to the blocking. After the LZW decoder
// completes, there will be a 0-byte block remaining (0, ()), which is
// consumed when checking that the blockReader is exhausted.
//
// To avoid the allocation of a bufio.Reader for the lzw Reader, blockReader
// implements io.ByteReader and buffers blocks into the decoder's "tmp" buffer.
@gopherbot
Copy link

Change https://golang.org/cl/331652 mentions this issue: image/gif: fix typo in type blockReader struct docs

@ianlancetaylor
Copy link
Contributor

I'm not sure what is going on here but we just got at least three changes fixing this problem. I'm going to try to go with the one that arrived first.

@hiroakis
Copy link
Author

@ianlancetaylor I'm sorry for that. I could not find any issue, so I opened this issue and sent a change above. Should I abandon my change?

@ianlancetaylor
Copy link
Contributor

It's fine, I will take care of it. Thanks for working to make Go better.

I'm curious, though: is there some reason that we got three different fixes for the same problem at about the same time?

@hiroakis
Copy link
Author

A Japanese Gopher, @tenntenn tweeted this typo https://twitter.com/tenntenn/status/1409887563041607682 . This is the reason why some Japanese submitted the same changes. I guess.

@ianlancetaylor
Copy link
Contributor

Thanks!

@dmitshur dmitshur added this to the Go1.17 milestone Jun 29, 2021
@dmitshur dmitshur added Documentation NeedsFix The path to resolution is known, but the work has not been done. labels Jun 29, 2021
satorunooshie added a commit to satorunooshie/go that referenced this issue Jun 29, 2021
@gopherbot
Copy link

Change https://golang.org/cl/331593 mentions this issue: image/gif: typo in type blockReader struct docs

@gopherbot
Copy link

Change https://golang.org/cl/331649 mentions this issue: image/gif: fix typo in the comment (io.ReadByte -> io.ByteReader)

@golang golang locked and limited conversation to collaborators Jun 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants