fzdwx commented on code in PR #188:
URL: https://github.com/apache/skywalking-go/pull/188#discussion_r1676573253
##########
plugins/mux/serve_interceptor.go:
##########
@@ -68,3 +90,18 @@ func (w *writerWrapper) WriteHeader(statusCode int) {
w.statusCode = statusCode
w.ResponseWriter.WriteHeader(statusCode)
}
+
+func newWriterWrapperWithHijacker(writer http.ResponseWriter, hijacker
http.Hijacker) *writerWrapperWithHijacker {
+ wrapper := newWriterWrapper(writer)
+ return &writerWrapperWithHijacker{
+ ResponseWriter: wrapper,
+ writer: wrapper,
Review Comment:
I have tried modifying it to just use `*writerWrapper`
```go
type writerWrapperWithHijacker struct {
*writerWrapper
http.Hijacker
}
```
But when building the following log appears:
```
go build -toolexec="/path/to/agent" -a .
# github.com/gorilla/mux
$WORK/b289/skywalking_enhance_mux_serve_interceptor.go:55:82:
wrapped.writerWrapper undefined (type
*skywalking_operatorTypeMuxwriterWrapperWithHijacker has no field or method
writerWrapper)
$WORK/b289/skywalking_enhance_mux_serve_interceptor.go:94:3: unknown field
writerWrapper in struct literal of type
skywalking_operatorTypeMuxwriterWrapperWithHijacker
2024/07/13 08:18:56 exit status 2
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]