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

some problem about gzip writer not use sync pool in middleware/compress.go #57

Open
imxyb opened this issue Sep 21, 2020 · 0 comments
Open

Comments

@imxyb
Copy link

imxyb commented Sep 21, 2020

Looking at the git commit history, I found that the sync pool of the gzip writer was removed. The reason is to fix the issue here: #13. But I still don't understand the reason for this deletion. I guess tha Is it because there is no way to return an error when using sync pool?

the removed code:

func gzipPool(config GzipConfig) sync.Pool {
	return sync.Pool{
		New: func() interface{} {
                        // can not return error here
			w, _ := gzip.NewWriterLevel(ioutil.Discard, config.Level)
			return w
		},
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant