1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 18:00:43 +00:00

fix lint errors

This commit is contained in:
Darien Raymond 2018-02-12 21:35:10 +01:00
parent ae395bbe1f
commit 31d1fb6cc3
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -62,7 +62,9 @@ func (w *tcpWorker) callback(conn internet.Connection) {
newError("connection ends").Base(err).WriteToLog()
}
cancel()
conn.Close()
if err := conn.Close(); err != nil {
newError("failed to close connection").Base(err).WriteToLog()
}
}
func (w *tcpWorker) Proxy() proxy.Inbound {
@ -128,7 +130,7 @@ func (c *udpConn) Write(buf []byte) (int, error) {
}
func (c *udpConn) Close() error {
common.Close(c.done)
common.Must(c.done.Close())
return nil
}
@ -254,11 +256,15 @@ func (w *udpWorker) Start() error {
}
func (w *udpWorker) Close() error {
w.Lock()
defer w.Unlock()
if w.hub != nil {
w.hub.Close()
w.done.Close()
common.Close(w.proxy)
}
common.Must(w.done.Close())
common.Close(w.proxy)
return nil
}