Skip to content

Commit

Permalink
重命名Response的writer为InnerWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
bddjr committed Jun 20, 2024
1 parent 43ad8c0 commit abb2062
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type Response struct {
*http.Response

writer io.Writer
InnerWriter io.Writer
}

func NewResponse(w io.Writer) *Response {
Expand All @@ -24,7 +24,7 @@ func NewResponse(w io.Writer) *Response {
Close: true,
StatusCode: 400,
},
writer: w,
InnerWriter: w,
}
resp.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat))
resp.Header.Set("X-Redirect-By", "hlfhr")
Expand Down Expand Up @@ -53,7 +53,7 @@ func (resp Response) Write(a ...any) error {
resp.Body = nil
resp.ContentLength = 0
}
return resp.Response.Write(resp.writer)
return resp.Response.Write(resp.InnerWriter)
}

// Example:
Expand Down

0 comments on commit abb2062

Please sign in to comment.