Ignore new static check error

This commit is contained in:
Paul Lorenz
2026-02-18 03:35:06 -05:00
parent 82dcd5f0cc
commit 6ddc09a4af
2 changed files with 10 additions and 2 deletions
+1
View File
@@ -14,6 +14,7 @@ linters:
- "-QF1001" # could apply De Morgan's law
- "-ST1016" # methods on the same type should have the same receiver name
- "-QF1002" # could use tagged switch on err
- "-QF1012" # Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) (staticcheck)
- "-SA1019" # x509.IsEncryptedPEMBlock has been deprecated since Go 1.16
run:
build-tags:
+9 -2
View File
@@ -191,8 +191,8 @@ func (self *zcatAction) copy(writer io.Writer, reader io.Reader, desc string) {
} else {
pfxlog.Logger().WithField("desc", desc).Info("connection closed")
}
if zconn, ok := writer.(edge.Conn); ok {
if err = zconn.CloseWrite(); err != nil {
if cw, ok := writer.(edge.CloseWriter); ok {
if err = cw.CloseWrite(); err != nil {
pfxlog.Logger().WithError(err).Error("error closing write side of ziti connection")
}
}
@@ -233,3 +233,10 @@ func (c *connProxy) SetReadDeadline(t time.Time) error {
func (c *connProxy) SetWriteDeadline(t time.Time) error {
return c.conn.Load().SetWriteDeadline(t)
}
func (c *connProxy) CloseWrite() error {
if cw, ok := c.conn.Load().(edge.Conn); ok {
return cw.CloseWrite()
}
return nil
}