Skip to content

Commit

Permalink
cleanup: removed useless anonymous function definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Facchetti committed Mar 15, 2022
1 parent 51d2da2 commit 73c9f04
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,10 @@ func Proxy(log *logrus.Entry, w http.ResponseWriter, r *http.Request, sz int) {
_, _ = io.Copy(c2, buf)
}()

func() {
// copy from c2->c1. Call c1.CloseWrite() when done.
defer func() {
_ = c1.(interface{ CloseWrite() error }).CloseWrite()
}()
_, _ = io.Copy(c1, c2)
// copy from c2->c1. Call c1.CloseWrite() when done.
defer func() {
_ = c1.(interface{ CloseWrite() error }).CloseWrite()
}()
_, _ = io.Copy(c1, c2)

}

0 comments on commit 73c9f04

Please sign in to comment.