Skip to content

Commit

Permalink
Update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
9seconds committed Feb 24, 2021
1 parent 8c622c5 commit 3d93671
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v2
with:
version: v1.35.2
version: v1.37.1
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

GOLANGCI_LINT_VERSION := v1.35.2
GOLANGCI_LINT_VERSION := v1.37.1

GOBIN := $(ROOT_DIR)/.bin
GOTOOL := env "GOBIN=$(GOBIN)" "PATH=$(ROOT_DIR)/.bin:$(PATH)"
Expand Down
3 changes: 1 addition & 2 deletions auth/ip_whitelist_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ type ipWhitelist struct {

func (i *ipWhitelist) Authenticate(ctx *fasthttp.RequestCtx) (string, error) {
ip := ctx.RemoteIP()
ip4 := ip.To4()

if ip4 != nil {
if ip4 := ip.To4(); ip4 != nil {
addr := patricia.NewIPv4AddressFromBytes(ip4, 32)

if ok, user, err := i.v4.FindDeepestTag(addr); ok && err == nil {
Expand Down
4 changes: 3 additions & 1 deletion dialers/http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ func (h *httpProxy) Dial(ctx context.Context, host, port string) (net.Conn, erro
return h.baseDialer.Dial(ctx, h.proxyHost, h.proxyPort)
}

func (h *httpProxy) UpgradeToTLS(ctx context.Context, conn net.Conn, host, port string) (net.Conn, error) {
func (h *httpProxy) UpgradeToTLS(ctx context.Context, // nolint: cyclop
conn net.Conn,
host, port string) (net.Conn, error) {
subCtx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (e EventType) IsUser() bool {
}

// String conforms fmt.Stringer interface.
func (e EventType) String() string {
func (e EventType) String() string { // nolint: cyclop
switch e {
case EventTypeNotSet:
return "NOT_SET"
Expand Down
2 changes: 1 addition & 1 deletion headers/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (h *Headers) pushHeaders(buf *bytes.Buffer) {
// its contents.
//
// Ananlogy: git pull where origin is fasthttp.Header.
func (h *Headers) Pull() error {
func (h *Headers) Pull() error { // nolint: cyclop
h.Headers = h.Headers[:0]

if h.original == nil {
Expand Down
2 changes: 1 addition & 1 deletion http/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

// Execute sends an http request and assign a streaming body to the
// given response. conn is a closable connection to the netloc.
func Execute(ctx context.Context, // nolint: funlen
func Execute(ctx context.Context, // nolint: funlen, cyclop
conn io.ReadWriteCloser,
request *fasthttp.Request,
response *fasthttp.Response) error {
Expand Down

0 comments on commit 3d93671

Please sign in to comment.