This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hw06pipelineexecution | |
import ( | |
"strconv" | |
"testing" | |
"time" | |
"github.com/stretchr/testify/require" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Comments started with [!] are explanations of my workflow with golangci-lint. | |
# Another comments are real comments in my config. | |
# [!] Examine the https://golangci-lint.run/usage/configuration/ to know all possibilities. | |
run: | |
timeout: 5m | |
modules-download-mode: vendor # [!] if you are using vendoring | |
build-tags: | |
- integration # [!] If you disable code for integration tests to run all unit tests, enable it to lint all the same. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func wrapResponseWriter(w http.ResponseWriter, codeHook func(int)) http.ResponseWriter { | |
rw := &rw{w: w, codeHook: codeHook} | |
hj, hasHijack := w.(http.Hijacker) | |
fl, hasFlusher := w.(http.Flusher) | |
rf, hasReadFrom := w.(io.ReaderFrom) | |
switch { | |
case hasHijack && hasFlusher && hasReadFrom: | |
return struct { | |
http.ResponseWriter |