From e06e3db50a6c92539ab276e13c2a21b2edc8eb46 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 23 Oct 2017 17:39:15 +0200 Subject: [PATCH] fix lint warnings --- proxy/blackhole/blackhole.go | 4 ++-- proxy/blackhole/config.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy/blackhole/blackhole.go b/proxy/blackhole/blackhole.go index ce3fe63a1..b324a97ab 100644 --- a/proxy/blackhole/blackhole.go +++ b/proxy/blackhole/blackhole.go @@ -29,8 +29,8 @@ func New(ctx context.Context, config *Config) (*Handler, error) { } // Process implements OutboundHandler.Dispatch(). -func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error { - v.response.WriteTo(outboundRay.OutboundOutput()) +func (h *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error { + h.response.WriteTo(outboundRay.OutboundOutput()) // Sleep a little here to make sure the response is sent to client. time.Sleep(time.Second) outboundRay.OutboundOutput().CloseError() diff --git a/proxy/blackhole/config.go b/proxy/blackhole/config.go index 2c27a344d..88c58c9a3 100644 --- a/proxy/blackhole/config.go +++ b/proxy/blackhole/config.go @@ -1,6 +1,7 @@ package blackhole import ( + "v2ray.com/core/common" "v2ray.com/core/common/buf" "v2ray.com/core/common/serial" ) @@ -27,7 +28,7 @@ func (*NoneResponse) WriteTo(buf.Writer) {} // WriteTo implements ResponseConfig.WriteTo(). func (*HTTPResponse) WriteTo(writer buf.Writer) { b := buf.NewLocal(512) - b.AppendSupplier(serial.WriteString(http403response)) + common.Must(b.AppendSupplier(serial.WriteString(http403response))) writer.Write(buf.NewMultiBufferValue(b)) }