Skip to content

Commit

Permalink
martian: fix linkname
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Aug 14, 2024
1 parent eda19bf commit c1d4053
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/martian/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ func errno(v error) uintptr {
return 0
}

//go:linkname h2ErrClosedBody golang.org/x/net/http2.h2ErrClosedBody
//go:linkname h2ErrClosedBody golang.org/x/net/http2.errClosedBody
var h2ErrClosedBody error //nolint:errname // this is an exported variable from golang.org/x/net/http2

func init() {
if h2ErrClosedBody == nil {
panic("http2.errClosedBody not linked")
}
}

// isClosedConnError reports whether err is an error from use of a closed network connection.
func isClosedConnError(err error) bool {
if err == nil {
Expand Down

0 comments on commit c1d4053

Please sign in to comment.