Compare commits

..
2 Commits
Author SHA1 Message Date
Sebi 9d01b62b98 Merge pull request 'fix(platform): document the methods of the gzip writer' (#166) from fix/lint-compress into main
ci / test (push) Successful in 16m14s
ci / image (push) Successful in 3m36s
release / release (push) Successful in 37m38s
ci / lint (push) Successful in 6m13s
ci / build (push) Successful in 17m22s
2026-11-27 06:19:53 +00:00
Sebastian UnterschützandClaude Opus 5.5 4aa22327c2 fix(platform): document the methods of the gzip writer
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / image (pull_request) Successful in 5m37s
ci / test (pull_request) Successful in 8m55s
ci / build (pull_request) Successful in 20m17s
ci / lint (pull_request) Successful in 12m18s
golangci-lint (revive) requires comments on exported methods.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-27 07:18:09 +01:00
+3
View File
@@ -104,6 +104,7 @@ func (w *gzipWriter) decide() {
w.gz.Reset(w.ResponseWriter)
}
// Write compresses b if decide chose to, which it does at the first write.
func (w *gzipWriter) Write(b []byte) (int, error) {
if !w.decided {
if w.Header().Get("Content-Type") == "" {
@@ -117,10 +118,12 @@ func (w *gzipWriter) Write(b []byte) (int, error) {
return w.gz.Write(b)
}
// WriteString writes s like Write, so strings are compressed as well.
func (w *gzipWriter) WriteString(s string) (int, error) {
return w.Write([]byte(s))
}
// Flush sends what is compressed so far, for responses that stream.
func (w *gzipWriter) Flush() {
if w.gz != nil {
_ = w.gz.Flush()