diff --git a/proxy/freedom/freedom.go b/proxy/freedom/freedom.go index 93b44a73f..b6058f0aa 100644 --- a/proxy/freedom/freedom.go +++ b/proxy/freedom/freedom.go @@ -59,8 +59,7 @@ func (this *FreedomConnection) Dispatch(firstPacket v2net.Packet, ray ray.Outbou defer readMutex.Unlock() defer close(output) - var reader io.Reader - reader = conn + var reader io.Reader = conn if firstPacket.Destination().IsUDP() { reader = v2net.NewTimeOutReader(16 /* seconds */, conn) diff --git a/proxy/http/http_test.go b/proxy/http/http_test.go index 4f4930d8c..98cddc823 100644 --- a/proxy/http/http_test.go +++ b/proxy/http/http_test.go @@ -9,7 +9,7 @@ import ( ) func TestHopByHopHeadersStrip(t *testing.T) { - var rawRequest = `GET /pkg/net/http/ HTTP/1.1 + rawRequest := `GET /pkg/net/http/ HTTP/1.1 Host: golang.org Connection: keep-alive,Foo, Bar Foo: foo diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index 6ef0d86b3..81775ee06 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -127,8 +127,7 @@ func (this *VMessInboundHandler) HandleConnection(connection *hub.TCPConn) { data.Release() responseWriter.Write(buffer.Value) go func(finish *sync.Mutex) { - var writer v2io.Writer - writer = v2io.NewAdaptiveWriter(responseWriter) + var writer v2io.Writer = v2io.NewAdaptiveWriter(responseWriter) if request.IsChunkStream() { writer = vmessio.NewAuthChunkWriter(writer) } diff --git a/proxy/vmess/outbound/outbound.go b/proxy/vmess/outbound/outbound.go index f4a469d13..9ae7629fc 100644 --- a/proxy/vmess/outbound/outbound.go +++ b/proxy/vmess/outbound/outbound.go @@ -140,8 +140,7 @@ func (this *VMessOutboundHandler) handleRequest(conn net.Conn, request *protocol } if moreChunks { - var streamWriter v2io.Writer - streamWriter = v2io.NewAdaptiveWriter(encryptRequestWriter) + var streamWriter v2io.Writer = v2io.NewAdaptiveWriter(encryptRequestWriter) if request.IsChunkStream() { streamWriter = vmessio.NewAuthChunkWriter(streamWriter) }