Skip to content

Conversation

@PYxy
Copy link
Contributor

@PYxy PYxy commented Oct 8, 2023

No description provided.

@PYxy
Copy link
Contributor Author

PYxy commented Oct 8, 2023

func (r responseWriter) WriteString(data string) (int, error) {
curLen := int64(len(data))
if curLen >= r.maxLength {
data = data[:r.maxLength]
}
r.al.RespBody = data
return r.ResponseWriter.WriteString(data)
}
不需要重写这个方法 也可以实现 记录响应体, 是不是测试有什么地方没测到呢?

@flycash
Copy link
Contributor

flycash commented Oct 8, 2023

func (r responseWriter) WriteString(data string) (int, error) { curLen := int64(len(data)) if curLen >= r.maxLength { data = data[:r.maxLength] } r.al.RespBody = data return r.ResponseWriter.WriteString(data) } 不需要重写这个方法 也可以实现 记录响应体, 是不是测试有什么地方没测到呢?

我也没仔细看 GIN 的源码,你可以暂时不实现这个方法。

@flycash flycash merged commit 3702e7b into ecodeclub:main Oct 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants