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

Comments

@hiroakis
Copy link

@hiroakis hiroakis commented Jun 29, 2021

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

@gopherbot gopherbot commented Jun 29, 2021

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

Loading

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 29, 2021

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.

Loading

@hiroakis
Copy link
Author

@hiroakis hiroakis commented Jun 29, 2021

@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?

Loading

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 29, 2021

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?

Loading

@hiroakis
Copy link
Author

@hiroakis hiroakis commented Jun 29, 2021

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.

Loading

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 29, 2021

Thanks!

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 29, 2021

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

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 30, 2021

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

Loading

@gopherbot gopherbot closed this in 7d0e9e6 Jun 30, 2021
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.

4 participants