Fast linters Runner for Go

golangci-lint logo

golangci-lint

Fast linters runner for Go


golangci-lint is a fast Go linters runner. It runs linters in parallel, uses caching, supports yaml config, has integrations with all major IDE and has dozens of linters included.

Install golangci-lint

Documentation

Documentation is hosted at https://golangci-lint.run.

Badges

Build Status License Release Docker Github Releases Stats of golangci-lint

Contributors

This project exists thanks to all the people who contribute. How to contribute.

Core Team

About core team

The GolangCI Core Team is a group of contributors that have demonstrated a lasting enthusiasm for the project and community. The GolangCI Core Team has GitHub admin privileges on the repo.

Responsibilities

The Core Team has the following responsibilities:

  1. Being available to answer high-level questions about vision and future.
  2. Being available to review longstanding/forgotten pull requests.
  3. Occasionally check issues, offer input, and categorize with GitHub issue labels.
  4. Looking out for up-and-coming members of the GolangCI community who might want to serve as Core Team members.
  5. Note that the Core Team – and all GolangCI contributors – are open source volunteers; membership on the Core Team is expressly not an obligation. The Core Team is distinguished as leaders in the community and while they are a good group to turn to when someone needs an answer to a question, they are still volunteering their time, and may not be available to help immediately.

Denis Isaev

Aleksandr Razumov

Team


Sergey Vilgelm

Ludovic Fernandez

Tam Mach

Trevor Pounds

Simon Sawert

@iwankgb

Long Dai

Andrew Shannon Brown

Sascha Grunert

Denis Tingaikin

Ryan Currah

Denis Krivak

Pierre Durand

Duco van Amstel

Will Dixon

David Lobe

Nishanth Shanmugham

Melvin

Oleg Butuzov

Matouš Dzivjak

Alec Thomas

Alexey Palazhchenko

Sebastien Rosset

Joe Wilner

Soichiro Kashima

Nuruddin Ashr

Mateusz Gozdek

Tim Heckman

Colin Arnott

Dan Kortschak

Ryan Boehning

James

Luke Shumaker

Aliaksandr Mianzhynski

Romanos
And 200 more our team members

Aneesh Agrawal

Vladimir Evgrafov

sonatard

ZhangYunHao

@odidev

NiseVoid

Sean DuBois

Viktoras

Agniva De Sarker

Henrik Johansson

SystemGlitch

John Starich

Koichi Shiraishi

Bart

gaojingyu

Patrick Kuca

Iskander (Alex) Sharipov

Viacheslav Poturaev

Lukas Malkmus

David Braley

Aleksey Bakin

Kensei Nakada

Kunwardeep

Eugene Simonov

Stephan Renatus

Diego Pontoriero

Daniel Helfand

Zik

Alex Collins

Ryo Nakao

Pierre R

Tommy Mühle

Sebastiaan van Stijn

@Dominik-K

ferhat elmas

M. Ángel Jimeno

Chris Drew

Marat Reymers

Teiva Harsanyi

Peter Mescalchin

Craig Silverstein

Ariel Mashraki

Denis Isaev

Tom Payne

francisco souza

Ryan Olds

Hiroki Suezawa

Fabrice

Christoph Blecker

Mateusz Bilski

Stephanie Wilde-Hobbs

Cory LaNou

Vitaly Isaev

Shulhan

Renato Suero

Ben Wells

Brian Flad

Jakub Chábek

tdakkota

Eric Wohltman

Sean McGinnis

masibw

Gianguido Sora'

Sonia Hamilton

Berezhnoy Pavel

Henry

Neha Viswanathan

Sindre Røkenes Myren

Aofei Sheng

Bartłomiej Klimczak

Maksym Pavlenko

Jonathan Chappelow

Ivan

James Lucktaylor

Dale Hui

Ondrej Fabry

proton

Markus

Andrew Lavery

Kishan B

Robert Liebowitz

Tariq Ibrahim

Peter Štibraný

kaixiang zhong

@ced42

David Bariod

Derek Perkins

Eldar Rakhimberdin

Toon Schoenmakers

Cezar Sá Espinola

Ben Paxton

Andrey Kuchin

Connor Adams

Draven

Martins Irbe

Rodrigo Brito

Mark Sart

Joshua Rubin

Kyoichiro Yamada

Sebastian Spaink

Linus Arver

Glen Mailer

Ian Howell

Chris K

Tom Arrell

Marko

Chris Lewis

David Gleich

Muhammad Ikhsan

Denis Titusov

Terdunov Vyacheslav

Sean Chittenden

Hui Zhu

@Harsimran1

rinsuki

Anton Antonov

Elliot Shepherd

@nvartolomei

Martin Etmajer

@techknowlogick

Fisher Xu

Matthew Poer

Cody Ley-Han

Marc Tudurí

Patrick Zhang

darklore

@to6ka

Wilkins

Collin Kreklow

Grigory Zubankov

Marcin Owsiany

@xxpxxxxp

Kamil Samigullin

Boban Acimovic

David Hill

Troy Ronda

Osamu TONOMORI

Bo Liu

Steven Allen

Colin Arnott

Eran Levy

Roman Leventov

Eric Jain

Michael

Evgeniy Kulikov

Chris Nesbitt-Smith

Daniel Caballero

Carlton Henderson

Shintaro Ikeda

Matt Braymer-Hayes

@xuri

Charl Matthee

Sriram Venkatesh

Peter Schuller

David Golub

Alexander Morozov

Hernan Bandura

Liam White

Alex Dupre

Juanito

Jinming Yue

Igor Zibarev

@wxdao

Kévin Dunglas

Sijie Yang

Stephen

Thang Minh Vu

Julia Ogris

Greg Curtis

@ac-rappi

Dudás Ádám

Abhishek | अभिषेक

Irina

Petr Pučil

Dima

Mitsuo Heijo

Alessio Treglia

Alay Patel

Martin Hutchinson

Emanuel Bennici

Christian Clauss

Korjavin Ivan

Francois Parquet

Robert Kopaczewski

@opennota

Cyrille Meichel

neglect-yp

Ben Ye

@jumpeiMano

Wei Jian Gan

Tamás Gulácsi

Jack Wilsdon

Michał Suchwałko

Alexander Apalikov

Domas Tamašauskas

Stéphane Chausson

neo_sli

@srdhoni

Daniele

Thomas Bonfort

Stargazers over time

Stargazers over time

Comments
  • Can't run linter goanalysis_metalinter: failed prerequisites

    Can't run linter goanalysis_metalinter: failed prerequisites

    Sometimes, when running golangci-lint on https://github.com/cozy/cozy-stack, I have a warning about failed_prerequisites:

    WARN [runner] Can't run linter goanalysis_metalinter: fact_purity: failed prerequisites: [email protected]/cozy/cozy-stack/model/instance/lifecycle [github.com/cozy/cozy-stack/model/app.test]
    
    • [X] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
    • [X] Yes, I've searched similar issues on GitHub and didn't find any.
    • [X] Yes, I've included all information below (version, config, etc).

    Please include the following information:

    Version of golangci-lint
    $ golangci-lint --version
    golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:16:56Z
    
    Config file
    $ cat .golangci.yml
    cat: .golangci.yml: No such file or directory
    
    Go environment
    $ go version && go env
    go version go1.13.1 linux/amd64
    GO111MODULE=""
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/home/nono/.cache/go-build"
    GOENV="/home/nono/.config/go/env"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="linux"
    GOPATH="/home/nono/go"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/nix/store/2kzdq7gyxz9jqfqcrp97z2y03vbw4glc-go-1.13.1/share/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/nix/store/2kzdq7gyxz9jqfqcrp97z2y03vbw4glc-go-1.13.1/share/go/pkg/tool/linux_amd64"
    GCCGO="gccgo"
    AR="ar"
    CC="/nix/store/7hzmz83nv8khpwsk858yaac7y3idh0a7-gcc-wrapper-8.3.0/bin/cc"
    CXX="g++"
    CGO_ENABLED="1"
    GOMOD="/home/nono/cc/stack/go.mod"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build302705204=/tmp/go-build -gno-record-gcc-switches"
    
    Verbose output of running
    $ golangci-lint run -v
    INFO [config_reader] Config search paths: [./ /home/nono/cc/stack /home/nono/cc /home/nono /home /] 
    INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck] 
    INFO [loader] Go packages loading at mode 575 (exports_file|types_sizes|compiled_files|deps|files|imports|name) took 2.691690133s 
    INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 70.353413ms 
    INFO [runner/unused/goanalysis] analyzers took 5.857582585s with top 10 stages: buildssa: 4.867487779s, U1000: 990.094806ms 
    INFO [runner/goanalysis_metalinter/goanalysis] analyzers took 9.763996494s with top 10 stages: buildssa: 4.693446351s, ineffassign: 503.987592ms, vrp: 405.948511ms, inspect: 367.360506ms, varcheck: 167.809469ms, SA4018: 166.777714ms, isgenerated: 163.478578ms, deadcode: 160.6481ms, errcheck: 147.053834ms, structcheck: 142.659624ms 
    WARN [runner] Can't run linter goanalysis_metalinter: ctrlflow: failed prerequisites: [email protected]/cozy/cozy-stack/web/accounts [github.com/cozy/cozy-stack/web/middlewares.test] 
    INFO [runner] processing took 4.732µs with stages: max_same_issues: 1.074µs, skip_dirs: 500ns, cgo: 493ns, nolint: 373ns, filename_unadjuster: 361ns, max_from_linter: 303ns, exclude: 226ns, skip_files: 201ns, path_prettifier: 200ns, uniq_by_line: 170ns, identifier_marker: 154ns, max_per_file_from_linter: 140ns, diff: 138ns, path_shortener: 134ns, autogenerated_exclude: 89ns, source_code: 89ns, exclude-rules: 87ns 
    INFO [runner] linters took 3.157498783s with stages: unused: 1.664301241s, goanalysis_metalinter: 1.493144531s 
    INFO File cache stats: 0 entries of total size 0B 
    INFO Memory: 60 samples, avg is 407.5MB, max is 1076.4MB 
    INFO Execution took 5.924849209s
    
  • v1.47.1 much slower

    v1.47.1 much slower

    Welcome

    • [X] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
    • [X] Yes, I've searched similar issues on GitHub and didn't find any.
    • [X] Yes, I've included all information below (version, config, etc).
    • [X] Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

    Description of the problem

    Today, our CI pipelines moved to v1.47.1 and we immediately felt the pain: linting was suddenly taking about 3x longer, exhausting the resources of the CI VM (2 vCPU, 4GB RAM), even with a very small amount of changes and the "--new-from-rev master" flag. This behavior was consistent and observed on a dozen PRs today, even those with no change in the go code base. run is slower when compared to v1.46.2, which was our previous version.

    Running v1.47.1 from docker image: golangci/golangci-lint:latest-alpine Extra installations required for alpine: apk add git openssh-client bash ncurses gcc musl-dev

    CLI for linting: golangci-lint run --timeout 10m --new-from-rev master --build-tags integration

    Version of golangci-lint

    golangci-lint version running on the CI container.

    $ golangci-lint --version
    golangci-lint has version v1.47.1 built from ebd6dcbf on 2022-07-19T11:57:02Z
    

    Configuration file

    $ cat .golangci.yml
    linters-settings:
      govet:
        check-shadowing: true
      gocyclo:
        min-complexity: 25
      maligned:
        suggest-new: true
      dupl:
        threshold: 150
      goconst:
        min-len: 3
        min-occurrences: 2
      forbidigo:
        forbid:
          - ^print.*$
          - 'fmt\.Print.*'
      funlen:
        lines: 100
        statements: 50
      gocognit:
        min-complexity: 80 # This is super high value. We should gradually lower it to 30-40.
    run:
      skip-dirs:
        - integrationtest
    
    linters:
      enable:
        - gofmt
        - goimports
        - bodyclose
        - dupl
        - forbidigo
        - gocognit
        - gocritic
        - goimports
        - gosec
        - nakedret
        - nolintlint
        - revive
        - stylecheck
        - unconvert
        - unparam
      disable:
        - maligned
        - lll
        - gochecknoinits
        - gochecknoglobals
    
    

    Go environment

    go version running on the CI container.

    $ go version && go env
    go version go1.18.4 linux/amd64
    GO111MODULE="on"
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/root/.cache/go-build"
    GOENV="/root/.config/go/env"
    GOEXE=""
    GOEXPERIMENT=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOINSECURE=""
    GOMODCACHE="/go/pkg/mod"
    GONOPROXY="github.com/oneconcern/*"
    GONOSUMDB="github.com/oneconcern/*"
    GOOS="linux"
    GOPATH="/go"
    GOPRIVATE="github.com/oneconcern/*"
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/usr/local/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
    GOVCS=""
    GOVERSION="go1.18.4"
    GCCGO="gccgo"
    GOAMD64="v1"
    AR="ar"
    CC="gcc"
    CXX="g++"
    CGO_ENABLED="1"
    GOMOD="/root/project/go.mod"
    GOWORK=""
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3438759853=/tmp/go-build -gno-record-gcc-switches"
    

    Verbose output of running

    $ golangci-lint cache clean
    $ golangci-lint run -v
    # paste output here
    

    Code example or link to a public repository

    N/A (private repo)
  • go1.17 arm64 fails with can't load fmt error (>= 1.45.0)

    go1.17 arm64 fails with can't load fmt error (>= 1.45.0)

    Welcome

    • [X] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
    • [X] Yes, I've searched similar issues on GitHub and didn't find any.
    • [X] Yes, I've included all information below (version, config, etc).
    • [X] Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

    Description of the problem

    golangci-lint version 1.45.0 on linux arm64/aarch64 with go1.17.8 fails with this error

    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.22()
    	github.com/go-critic/[email protected]/checkers/embedded_rules.go:46 +0x488
    

    golangci-lint version 1.45.0 works just fine on amd64 with go1.17.8, as well as arm64 with go1.18

    Here's the whole process

    $ docker run -it --rm --entrypoint /bin/bash golang:1.17
    root@eb266021b73c:/go# uname -m
    aarch64
    root@eb266021b73c:/go# go version
    go version go1.17.8 linux/arm64
    root@eb266021b73c:/go# curl -SsLO https://github.com/golangci/golangci-lint/releases/download/v1.45.0/golangci-lint-1.45.0-linux-arm64.tar.gz
    root@eb266021b73c:/go# tar -xf golangci-lint-1.45.0-linux-arm64.tar.gz
    root@eb266021b73c:/go# golangci-lint-1.45.0-linux-arm64/golangci-lint
    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.22()
    	github.com/go-critic/[email protected]/checkers/embedded_rules.go:46 +0x488
    root@eb266021b73c:/go# 
    

    Version of golangci-lint

    root@eb266021b73c:/go# golangci-lint-1.45.0-linux-arm64/golangci-lint --version
    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.22()
    	github.com/go-critic/[email protected]/checkers/embedded_rules.go:46 +0x488
    root@eb266021b73c:/go# 
    

    Configuration file

    root@eb266021b73c:/go# cat .golangci.yml
    cat: .golangci.yml: No such file or directory
    root@eb266021b73c:/go# 
    

    Go environment

    root@eb266021b73c:/go# go version && go env
    go version go1.17.8 linux/arm64
    GO111MODULE=""
    GOARCH="arm64"
    GOBIN=""
    GOCACHE="/root/.cache/go-build"
    GOENV="/root/.config/go/env"
    GOEXE=""
    GOEXPERIMENT=""
    GOFLAGS=""
    GOHOSTARCH="arm64"
    GOHOSTOS="linux"
    GOINSECURE=""
    GOMODCACHE="/go/pkg/mod"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="linux"
    GOPATH="/go"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/usr/local/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64"
    GOVCS=""
    GOVERSION="go1.17.8"
    GCCGO="gccgo"
    AR="ar"
    CC="gcc"
    CXX="g++"
    CGO_ENABLED="1"
    GOMOD="/dev/null"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build850424411=/tmp/go-build -gno-record-gcc-switches"
    root@eb266021b73c:/go# 
    

    Verbose output of running

    root@eb266021b73c:/go# golangci-lint-1.45.0-linux-arm64/golangci-lint cache clean
    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.22()
    	github.com/go-critic/[email protected]/checkers/embedded_rules.go:46 +0x488
    root@eb266021b73c:/go# golangci-lint-1.45.0-linux-arm64/golangci-lint run -v
    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.22()
    	github.com/go-critic/[email protected]/checkers/embedded_rules.go:46 +0x488
    root@eb266021b73c:/go# 
    

    Code example or link to a public repository

    N/A error occurs before running the linters, no code is being linted

  • Panic since update to v1.43.0 (load embedded ruleguard rules: rules/rules.go:13: can't load fmt)

    Panic since update to v1.43.0 (load embedded ruleguard rules: rules/rules.go:13: can't load fmt)

    Welcome

    • [X] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
    • [X] Yes, I've searched similar issues on GitHub and didn't find any.
    • [X] Yes, I've included all information below (version, config, etc).
    • [X] Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

    Description of the problem

    Please read

    https://github.com/go-critic/go-critic/issues/1157

    Version of golangci-lint

    $ golangci-lint --version
    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.9()
            github.com/go-critic/[email protected]/checkers/checkers.go:58 +0x4b4
    

    Configuration file

    No file.

    Go environment

    $ go version && go env
    go version go1.17.1 darwin/arm64
    GO111MODULE="on"
    GOARCH="arm64"
    GOBIN="/Users/anthony/golang_workspace/bin"
    GOCACHE="/Users/anthony/Library/Caches/go-build"
    GOENV="/Users/anthony/Library/Application Support/go/env"
    GOEXE=""
    GOEXPERIMENT=""
    GOFLAGS=""
    GOHOSTARCH="arm64"
    GOHOSTOS="darwin"
    GOINSECURE=""
    GOMODCACHE="/Users/anthony/golang_workspace/pkg/mod"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="darwin"
    GOPATH="/Users/anthony/golang_workspace"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/usr/local/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
    GOVCS=""
    GOVERSION="go1.17.1"
    GCCGO="gccgo"
    AR="ar"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD="/Users/anthony/****/go.mod"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6t/v80c8sfs5zqf38b2yhzq592h0000gn/T/go-build1630597575=/tmp/go-build -gno-record-gcc-switches -fno-common"
    

    Verbose output of running

    $ golangci-lint cache clean
    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.9()
            github.com/go-critic/[email protected]/checkers/checkers.go:58 +0x4b4
    
    
    $ golangci-lint run -v
    panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
    
    goroutine 1 [running]:
    github.com/go-critic/go-critic/checkers.init.9()
            github.com/go-critic/[email protected]/checkers/checkers.go:58 +0x4b4
    
  • Build errors using Go 1.13

    Build errors using Go 1.13

    I'm currently getting build errors (master branch) trying to build golangci-lint with Go 1.13.

    The build error is: go: github.com/golangci/[email protected]: invalid pseudo-version: does not match version-control timestamp (2019-07-14T14:40:26Z)

    Here are a few details of my go env: GOARCH=amd64 GOOS=windows

    Let me know if you need any more details to reproduce.

    The reason I came across this is that go get with go 1.13 returns the errors below and I thought I'd try to use a locally build version of golangci-lint.

    go get -u github.com/golangci/golangci-lint/cmd/golangci-lint verifying github.com/golangci/[email protected]/go.mod: github.com/golangci/[email protected]/go.mod: reading https://sum.golang.org/lookup/github.com/golangci/[email protected]: 410 Gone verifying github.com/go-critic/[email protected]/go.mod: github.com/go-critic/[email protected]/go.mod: reading https://sum.golang.org/lookup/github.com/go-critic/[email protected]: 410 Gone

  • ERRO Running error: context loading failed: failed to load program with go/packages

    ERRO Running error: context loading failed: failed to load program with go/packages

    1. Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution) golangci-lint has version 1.14.0 built from 6c4d290 on 2019-02-11T06:59:20Z
    2. Config file: cat .golangci.yml
    run:
      # default concurrency is a available CPU number
      concurrency: 4
    
      # timeout for analysis, e.g. 30s, 5m, default is 1m
      deadline: 5m
    
      # which dirs to skip: they won't be analyzed;
      # can use regexp here: generated.*, regexp is applied on full path;
      # default value is empty list, but next dirs are always skipped independently
      # from this option's value:
      #   	vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
      skip-dirs:
        - genfiles$
        - vendor$
    
      # which files to skip: they will be analyzed, but issues from them
      # won't be reported. Default value is empty list, but there is
      # no need to include all autogenerated files, we confidently recognize
      # autogenerated files. If it's not please let us know.
      skip-files:
        - ".*\\.pb\\.go"
        - ".*\\.gen\\.go"
    
    
    # all available settings of specific linters
    linters-settings:
      errcheck:
        # report about not checking of errors in type assetions: `a := b.(MyStruct)`;
        # default is false: such cases aren't reported by default.
        check-type-assertions: false
    
        # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
        # default is false: such cases aren't reported by default.
        check-blank: false
      govet:
        # report about shadowed variables
        check-shadowing: false
      golint:
        # minimal confidence for issues, default is 0.8
        min-confidence: 0.0
      gofmt:
        # simplify code: gofmt with `-s` option, true by default
        simplify: true
      goimports:
        # put imports beginning with prefix after 3rd-party packages;
        # it's a comma-separated list of prefixes
        local-prefixes: istio.io/
      gocyclo:
        # minimal code complexity to report, 30 by default (but we recommend 10-20)
        min-complexity: 10
      maligned:
        # print struct with more effective memory layout or not, false by default
        suggest-new: true
      dupl:
        # tokens count to trigger issue, 150 by default
        threshold: 100
      goconst:
        # minimal length of string constant, 3 by default
        min-len: 3
        # minimal occurrences count to trigger, 3 by default
        min-occurrences: 3
      depguard:
        list-type: blacklist
        include-go-root: false
        packages:
          - github.com/davecgh/go-spew/spew
      misspell:
        # Correct spellings using locale preferences for US or UK.
        # Default is to use a neutral variety of English.
        # Setting locale to US will correct the British spelling of 'colour' to 'color'.
        locale: US
      lll:
        # max line length, lines longer will be reported. Default is 120.
        # '\t' is counted as 1 character by default, and can be changed with the tab-width option
        line-length: 160
        # tab width in spaces. Default to 1.
        tab-width: 1
      unused:
        # treat code as a program (not a library) and report unused exported identifiers; default is false.
        # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
        # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
        # with golangci-lint call it on a directory with the changed file.
        check-exported: false
      unparam:
        # call graph construction algorithm (cha, rta). In general, use cha for libraries,
        # and rta for programs with main packages. Default is cha.
        algo: cha
    
        # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
        # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
        # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
        # with golangci-lint call it on a directory with the changed file.
        check-exported: false
      nakedret:
        # make an issue if func has more lines of code than this setting and it has naked returns; default is 30
        max-func-lines: 30
      prealloc:
        # XXX: we don't recommend using this linter before doing performance profiling.
        # For most programs usage of prealloc will be a premature optimization.
    
        # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
        # True by default.
        simple: true
        range-loops: true # Report preallocation suggestions on range loops, true by default
        for-loops: false # Report preallocation suggestions on for loops, false by default
    
    linters:
      enable:
        - deadcode
        - goimports
        - golint
        - govet
        - gosimple
        - interfacer
        - lll
        - misspell
        - staticcheck
        - structcheck
        - ineffassign
        - unconvert
        - unparam
        - unused
        - varcheck
      enable-all: false
      disable:
        - gocritic
        - prealloc
        - typecheck
        - megacheck
        - nakedret
        - scopelint
        - gochecknoglobals
        - gochecknoinits
        - gosec
          # start here to enable back all gometalinter linters
        - errcheck
        - goconst
        - maligned
      disable-all: false
      presets:
        - bugs
        - unused
      fast: false
    
    
    issues:
      # List of regexps of issue texts to exclude, empty list by default.
      # But independently from this option we use default exclude patterns,
      # it can be disabled by `exclude-use-default: false`. To list all
      # excluded by default patterns execute `golangci-lint run --help`
      exclude: []
    
      # Independently from option `exclude` we use default exclude patterns,
      # it can be disabled by this option. To list all
      # excluded by default patterns execute `golangci-lint run --help`.
      # Default value for this option is true.
      exclude-use-default: true
    
      # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
      max-per-linter: 0
    
      # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
      max-same-issues: 0
    
    1. Go environment: go version && go env
    $ go version && go env
    go version go1.11.2 linux/amd64
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/home/admin/.cache/go-build"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/admin/go"
    GOPROXY=""
    GORACE=""
    GOROOT="/home/admin/linka-tools/go"
    GOTMPDIR=""
    GOTOOLDIR="/home/admin/linka-tools/go/pkg/tool/linux_amd64"
    GCCGO="gccgo"
    CC="gcc"
    CXX="g++"
    CGO_ENABLED="1"
    GOMOD=""
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build140861160=/tmp/go-build -gno-record-gcc-switches"
    
    1. Verbose output of running: golangci-lint run -v
    INFO [config_reader] Config search paths: [./ /home/admin/scanning/task-source/sofa-mosn /home/admin/scanning/task-source /home/admin/scanning /home/admin /home /]
    INFO [config_reader] Used config file .golangci.yml
    INFO [lintersdb] Active 12 linters: [deadcode goimports golint govet ineffassign interfacer lll misspell structcheck unconvert unparam varcheck]
    INFO [lintersdb] Active presets: [bugs unused]
    INFO [loader] Go packages loading at mode load deps types and syntax took 548.623388ms
    ERRO Running error: context loading failed: failed to load program with go/packages: go [list -e -json -compiled -test=true -export=false -deps=true -find=false -- ./...]: exit status 1: go build github.com/.../pkg/admin: no Go files in
    go build github.com/.../pkg/buffer: no Go files in
    go build github.com/.../pkg/config: no Go files in
    ......
    
  • CVE-2020-14040: v0.3.3 golang.org/x/text

    CVE-2020-14040: v0.3.3 golang.org/x/text

    CVE-2020-14040

    The x/text package before 0.3.3 for Go has a vulnerability in encoding/unicode that could lead to the UTF-16 decoder entering an infinite loop, causing the program to crash or run out of memory. An attacker could provide a single byte to a UTF16 decoder instantiated with UseBOM or ExpectBOM to trigger an infinite loop if the String function on the Decoder is called, or the Decoder is passed to golang.org/x/text/transform.String.

    Source: https://nvd.nist.gov/vuln/detail/CVE-2020-14040

  • build(deps): bump github.com/go-critic/go-critic from 0.5.6 to 0.6.1

    build(deps): bump github.com/go-critic/go-critic from 0.5.6 to 0.6.1

    Bumps github.com/go-critic/go-critic from 0.5.6 to 0.6.1.

    https://github.com/go-critic/go-critic/compare/v0.5.6...v0.6.1

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • could not run linter xxx:buildssa: analysis skipped: errors in package: xxx could not import xxx

    could not run linter xxx:buildssa: analysis skipped: errors in package: xxx could not import xxx

    Thank you for creating the issue!

    • [x] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
    • [x] Yes, I've searched similar issues on GitHub and didn't find any.
    • [x] Yes, I've included all information below (version, config, etc).

    Please include the following information:

    Version of golangci-lint
    $ golangci-lint --version
    golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:15:04Z
    
    Config file
    $ cat .golangci.yml
    cat: .golangci.yml: No such file or directory
    
    Go environment
    $ go version && go env
    go version go1.13.4 windows/amd64
    set GO111MODULE=
    set GOARCH=amd64
    set GOBIN=
    set GOCACHE=C:\Users\yindongchao\AppData\Local\go-build
    set GOENV=C:\Users\yindongchao\AppData\Roaming\go\env
    set GOEXE=.exe
    set GOFLAGS=
    set GOHOSTARCH=amd64
    set GOHOSTOS=windows
    set GONOPROXY=*.gitlab.com,*.gitee.com,*.inspur.com
    set GONOSUMDB=*.gitlab.com,*.gitee.com,*.inspur.com
    set GOOS=windows
    set GOPATH=C:\Users\yindongchao\go
    set GOPRIVATE=*.gitlab.com,*.gitee.com,*.inspur.com
    set GOPROXY=https://goproxy.io
    set GOROOT=c:\go
    set GOSUMDB=off
    set GOTMPDIR=
    set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
    set GCCGO=gccgo
    set AR=ar
    set CC=gcc
    set CXX=g++
    set CGO_ENABLED=1
    set GOMOD=
    set CGO_CFLAGS=-g -O2
    set CGO_CPPFLAGS=
    set CGO_CXXFLAGS=-g -O2
    set CGO_FFLAGS=-g -O2
    set CGO_LDFLAGS=-g -O2
    set PKG_CONFIG=pkg-config
    set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\YINDON~1\AppData\Local\Temp\go-build718758610=/tmp/go-build -gno-record-gcc-switches
    
    Verbose output of running
    $ golangci-lint run -v
    C:\Users\yindongchao\go\bin\golangci-lint.exe run -v --disable=typecheck --enable=bodyclose --enable=dogsled --enable=gocritic --enable=gocyclo --enable=golint --enable=gosec --enable=maligned --enable=prealloc --enable=stylecheck D:\Repo\git.inspur.com\inspur-cloud\g5-storage\pkg\incloud
    level=info msg="[config_reader] Config search paths: [./ D:\\Repo\\git.inspur.com\\inspur-cloud\\g5-storage\\pkg\\incloud D:\\Repo\\git.inspur.com\\inspur-cloud\\g5-storage\\pkg D:\\Repo\\git.inspur.com\\inspur-cloud\\g5-storage D:\\Repo\\git.inspur.com\\inspur-cloud D:\\Repo\\git.inspur.com D:\\Repo D:\\]"
    level=info msg="[lintersdb] Active 18 linters: [bodyclose deadcode dogsled errcheck gocritic gocyclo golint gosec gosimple govet ineffassign maligned prealloc staticcheck structcheck stylecheck unused varcheck]"
    level=info msg="[loader] Go packages loading at mode 575 (deps|files|imports|name|compiled_files|types_sizes|exports_file) took 1.3535824s"
    level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 2.4803ms"
    level=info msg="[runner/goanalysis_metalinter/goanalysis] analyzers took 1.488ms with top 10 stages: errcheck: 496µs, buildssa: 496µs, S1011: 496µs, unreachable: 0s, ST1011: 0s, SA5009: 0s, SA4008: 0s, S1019: 0s, fact_deprecated: 0s, shift: 0s"
    level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildssa: analysis skipped: errors in package: [D:\\Repo\\git.inspur.com\\inspur-cloud\\g5-storage\\pkg\\incloud\\brainkeeper.go:13:2: could not import k8s.io/client-go/kubernetes (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\kubernetes\\clientset.go:24:12: could not import k8s.io/client-go/discovery (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\discovery\\discovery_client.go:39:13: could not import k8s.io/client-go/rest (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\rest\\transport.go:24:2: could not import k8s.io/client-go/plugin/pkg/client/auth/exec (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\plugin\\pkg\\client\\auth\\exec\\exec.go:35:2: could not import golang.org/x/crypto/ssh/terminal (C:\\Users\\yindongchao\\go\\pkg\\mod\\golang.org\\x\\[email protected]\\ssh\\terminal\\util_windows.go:97:36: 2-valued windows.GetCurrentProcess() (value of type (windows.Handle, error)) where single value is expected))))) D:\\Repo\\git.inspur.com\\inspur-cloud\\g5-storage\\pkg\\incloud\\brainkeeper.go:14:2: could not import k8s.io/client-go/tools/leaderelection/resourcelock (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\tools\\leaderelection\\resourcelock\\configmaplock.go:26:15: could not import k8s.io/client-go/kubernetes/typed/core/v1 (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\kubernetes\\typed\\core\\v1\\componentstatus.go:29:7: could not import k8s.io/client-go/rest (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\rest\\transport.go:24:2: could not import k8s.io/client-go/plugin/pkg/client/auth/exec (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\plugin\\pkg\\client\\auth\\exec\\exec.go:35:2: could not import golang.org/x/crypto/ssh/terminal (C:\\Users\\yindongchao\\go\\pkg\\mod\\golang.org\\x\\[email protected]\\ssh\\terminal\\util_windows.go:97:36: 2-valued windows.GetCurrentProcess() (value of type (windows.Handle, error)) where single value is expected)))))]"
    level=info msg="[runner/unused/goanalysis] analyzers took 0s with top 10 stages: buildssa: 0s, U1000: 0s"
    level=warning msg="[runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [D:\\Repo\\git.inspur.com\\inspur-cloud\\g5-storage\\pkg\\incloud\\brainkeeper.go:13:2: could not import k8s.io/client-go/kubernetes (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\kubernetes\\clientset.go:24:12: could not import k8s.io/client-go/discovery (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\discovery\\discovery_client.go:39:13: could not import k8s.io/client-go/rest (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\rest\\transport.go:24:2: could not import k8s.io/client-go/plugin/pkg/client/auth/exec (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\plugin\\pkg\\client\\auth\\exec\\exec.go:35:2: could not import golang.org/x/crypto/ssh/terminal (C:\\Users\\yindongchao\\go\\pkg\\mod\\golang.org\\x\\[email protected]\\ssh\\terminal\\util_windows.go:97:36: 2-valued windows.GetCurrentProcess() (value of type (windows.Handle, error)) where single value is expected))))) D:\\Repo\\git.inspur.com\\inspur-cloud\\g5-storage\\pkg\\incloud\\brainkeeper.go:14:2: could not import k8s.io/client-go/tools/leaderelection/resourcelock (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\tools\\leaderelection\\resourcelock\\configmaplock.go:26:15: could not import k8s.io/client-go/kubernetes/typed/core/v1 (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\kubernetes\\typed\\core\\v1\\componentstatus.go:29:7: could not import k8s.io/client-go/rest (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\rest\\transport.go:24:2: could not import k8s.io/client-go/plugin/pkg/client/auth/exec (C:\\Users\\yindongchao\\go\\pkg\\mod\\k8s.io\\[email protected]\\plugin\\pkg\\client\\auth\\exec\\exec.go:35:2: could not import golang.org/x/crypto/ssh/terminal (C:\\Users\\yindongchao\\go\\pkg\\mod\\golang.org\\x\\[email protected]\\ssh\\terminal\\util_windows.go:97:36: 2-valued windows.GetCurrentProcess() (value of type (windows.Handle, error)) where single value is expected)))))]"
    level=info msg="[runner] processing took 0s with stages: nolint: 0s, max_per_file_from_linter: 0s, source_code: 0s, cgo: 0s, skip_files: 0s, exclude: 0s, diff: 0s, max_from_linter: 0s, max_same_issues: 0s, path_shortener: 0s, skip_dirs: 0s, identifier_marker: 0s, exclude-rules: 0s, uniq_by_line: 0s, filename_unadjuster: 0s, path_prettifier: 0s, autogenerated_exclude: 0s"
    level=info msg="[runner] linters took 1.3243193s with stages: goanalysis_metalinter: 888.3358ms, unused: 435.9835ms"
    level=info msg="File cache stats: 0 entries of total size 0B"
    level=info msg="Memory: 30 samples, avg is 53.7MB, max is 140.3MB"
    level=info msg="Execution took 2.8415811s"
    
    Process finished with exit code 0
    
  • Add severity to error messages (

    Add severity to error messages ("warning" vs. "error")

    Currently, all messages are treated as errors, and some number of issues are excluded by default. To provide more granular detail, it may make sense to flag certain issues as "warning" or "info" level messages instead of "error" or instead of being on the default exclude list.

    It may make sense to categorize certain linters as being warning or error level linters by default. For example, issues from gofmt are probably of severity "warning", while issues from go vet are probably of severity "error". Other linters like gas actually provide severities, which can be used directly.

  • Can't parse date when running

    Can't parse date when running

    Welcome

    • [X] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
    • [X] Yes, I've searched similar issues on GitHub and didn't find any.
    • [X] Yes, I've included all information below (version, config, etc).
    • [X] Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

    Description of the problem

    When running golangci-lint run -E gofmt I am shown an error:

    WARN [linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. 
    ERRO Running error: 1 error occurred:
            * can't run linter goanalysis_metalinter: goimports: can't extract issues from gofmt diff output "--- /Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot/client/reporting.go.orig\t2022-08-10 12:30:31\n+++ /Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot/client/reporting.go\t2022-08-10 12:30:31\n@@ -4,8 +4,9 @@\n \t\"context\"\n \t\"encoding/json\"\n \t\"fmt\"\n-\t\"github.com/Fonoa-Tech/reporting-api/generated/contracts\"\n \t\"net/url\"\n+\n+\t\"github.com/Fonoa-Tech/reporting-api/generated/contracts\"\n )\n \n type ReportingClient struct {\n": can't parse patch: parsing time "2022-08-10 12:30:31" as "2006-01-02 15:04:05 -0700": cannot parse "" as "-0700"
    

    Version of golangci-lint

    golangci-lint has version 1.46.2 built from a333689 on 2022-05-17T06:05:08Z

    Configuration file

    ---
    run:
      timeout: 3m
      build-tags:
        - integration
    
    linters:
      enable:
        - misspell
        - goimports
        - revive
        - gofmt
        - depguard
        - godot
    
    

    Go environment

    go version go1.18.2 darwin/arm64
    GO111MODULE="on"
    GOARCH="arm64"
    GOBIN=""
    GOCACHE="/Users/jacek.leszczynski/Library/Caches/go-build"
    GOENV="/Users/jacek.leszczynski/Library/Application Support/go/env"
    GOEXE=""
    GOEXPERIMENT=""
    GOFLAGS=""
    GOHOSTARCH="arm64"
    GOHOSTOS="darwin"
    GOINSECURE=""
    GOMODCACHE="/Users/jacek.leszczynski/gopath/pkg/mod"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="darwin"
    GOPATH="/Users/jacek.leszczynski/gopath"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/opt/homebrew/Cellar/go/1.18.2/libexec"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/opt/homebrew/Cellar/go/1.18.2/libexec/pkg/tool/darwin_arm64"
    GOVCS=""
    GOVERSION="go1.18.2"
    GCCGO="gccgo"
    AR="ar"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD="/Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot/go.mod"
    GOWORK=""
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jc/2hzf075172155k8m2zswff540000gq/T/go-build2249922677=/tmp/go-build -gno-record-gcc-switches -fno-common"
    

    Verbose output of running

    INFO [config_reader] Config search paths: [./ /Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot /Users/jacek.leszczynski/RiderProjects/reporting-tools/go /Users/jacek.leszczynski/RiderProjects/reporting-tools /Users/jacek.leszczynski/RiderProjects /Users/jacek.leszczynski /Users /] 
    INFO [config_reader] Used config file .golangci.yml 
    INFO [lintersdb] Active 16 linters: [deadcode depguard errcheck godot gofmt goimports gosimple govet ineffassign misspell revive staticcheck structcheck typecheck unused varcheck] 
    INFO [loader] Using build tags: [integration]     
    INFO [loader] Go packages loading at mode 575 (imports|deps|exports_file|files|name|types_sizes|compiled_files) took 379.585375ms 
    INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 3.7755ms 
    INFO [linters context/goanalysis] analyzers took 14.276696194s with top 10 stages: buildir: 9.462551828s, inspect: 803.317455ms, fact_deprecated: 507.355007ms, ctrlflow: 430.351534ms, nilness: 429.363872ms, printf: 362.387388ms, fact_purity: 344.798673ms, SA5012: 280.363134ms, the_only_name: 212.144167ms, typedness: 206.551703ms 
    WARN [runner] Can't run linter goanalysis_metalinter: goimports: can't extract issues from gofmt diff output "--- /Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot/client/reporting.go.orig\t2022-08-10 12:33:15\n+++ /Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot/client/reporting.go\t2022-08-10 12:33:15\n@@ -4,8 +4,9 @@\n \t\"context\"\n \t\"encoding/json\"\n \t\"fmt\"\n-\t\"github.com/Fonoa-Tech/reporting-api/generated/contracts\"\n \t\"net/url\"\n+\n+\t\"github.com/Fonoa-Tech/reporting-api/generated/contracts\"\n )\n \n type ReportingClient struct {\n": can't parse patch: parsing time "2022-08-10 12:33:15" as "2006-01-02 15:04:05 -0700": cannot parse "" as "-0700" 
    WARN [linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. 
    INFO [runner] processing took 2.708µs with stages: max_same_issues: 958ns, nolint: 334ns, max_from_linter: 333ns, skip_dirs: 208ns, severity-rules: 84ns, max_per_file_from_linter: 84ns, filename_unadjuster: 84ns, cgo: 83ns, autogenerated_exclude: 83ns, skip_files: 42ns, path_prefixer: 42ns, path_prettifier: 42ns, path_shortener: 42ns, sort_results: 42ns, diff: 42ns, exclude: 41ns, exclude-rules: 41ns, identifier_marker: 41ns, source_code: 41ns, uniq_by_line: 41ns 
    INFO [runner] linters took 4.578902583s with stages: goanalysis_metalinter: 4.57884975s, structcheck: 10.291µs 
    ERRO Running error: 1 error occurred:
            * can't run linter goanalysis_metalinter: goimports: can't extract issues from gofmt diff output "--- /Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot/client/reporting.go.orig\t2022-08-10 12:33:15\n+++ /Users/jacek.leszczynski/RiderProjects/reporting-tools/go/rot/client/reporting.go\t2022-08-10 12:33:15\n@@ -4,8 +4,9 @@\n \t\"context\"\n \t\"encoding/json\"\n \t\"fmt\"\n-\t\"github.com/Fonoa-Tech/reporting-api/generated/contracts\"\n \t\"net/url\"\n+\n+\t\"github.com/Fonoa-Tech/reporting-api/generated/contracts\"\n )\n \n type ReportingClient struct {\n": can't parse patch: parsing time "2022-08-10 12:33:15" as "2006-01-02 15:04:05 -0700": cannot parse "" as "-0700"
     
    INFO Memory: 51 samples, avg is 823.6MB, max is 1302.8MB 
    INFO Execution took 4.980535375s 
    

    Code example or link to a public repository

    Can't share code

  • unparam: bump to HEAD

    unparam: bump to HEAD

    mvdan/[email protected]

    Fixes #3426 (again)

    • The original fix to unparam was incomplete, this takes in the followup fix.

    Follow-up to #3429

    This update is done by hand because dependabot is not able to update non-semver dependency.

  • build(deps): bump gatsby-plugin-mdx from 3.15.2 to 5.3.1 in /docs

    build(deps): bump gatsby-plugin-mdx from 3.15.2 to 5.3.1 in /docs

    Bumps gatsby-plugin-mdx from 3.15.2 to 5.3.1.

    Release notes

    Sourced from gatsby-plugin-mdx's releases.

    v5.3.0

    Welcome to [email protected] release (December 2022 #1)

    Key highlights of this release:

    Bleeding Edge: Want to try new features as soon as possible? Install gatsby@next and let us know if you have any issues.

    Previous release notes

    Full changelog

    v5.2.0

    Welcome to [email protected] release (November 2022 #3)

    This is an out of band release due to the removal of the Potrace library in Gatsby. We'll continue with our biweekly schedule as normal.

    Bleeding Edge: Want to try new features as soon as possible? Install gatsby@next and let us know if you have any issues.

    v5.1.0

    Welcome to [email protected] release (November 2022 #2)

    This is the first minor release after the recent major release of Gatsby 5! We are focused on your feedback and implementing fixes as needed.

    If you haven’t migrated yet, please refer to the migration guide. We’ve done our best to make the transition smooth!

    Some brief notes about what Gatsby 5 brings to the table:

    • Slices API unlocks up to 90% reduction in build duration for content changes in highly shared components
    • Partial Hydration allows you to ship only the necessary JavaScript to the browser

    Bleeding Edge: Want to try new features as soon as possible? Install gatsby@next and let us know if you have any issues.

    v5.0.0

    Welcome to [email protected] release (November 2022 #1)

    Key highlights of this release:

    Major dependency updates:

    ... (truncated)

    Changelog

    Sourced from gatsby-plugin-mdx's changelog.

    5.3.1 (2022-12-14)

    Note: Version bump only for package gatsby-plugin-mdx

    5.3.0 (2022-12-13)

    🧾 Release notes

    Bug Fixes

    • update minor and patch dependencies for gatsby-plugin-mdx #37154 (0d40674)

    Chores

    5.2.0 (2022-11-25)

    🧾 Release notes

    Chores

    5.1.0 (2022-11-22)

    🧾 Release notes

    Note: Version bump only for package gatsby-plugin-mdx

    5.0.0 (2022-11-08)

    🧾 Release notes

    Bug Fixes

    Chores

    4.3.0 (2022-09-27)

    🧾 Release notes

    ... (truncated)

    Commits
    • 287cabd chore(release): Publish
    • b995fc2 chore(release): Publish
    • 03d6c59 chore(release): Publish next
    • 204ed0e chore(deps): update dependency typescript to ^4.9.3 (#37192)
    • 1dc347c chore(release): Publish next
    • 5a8879c chore(deps): update formatting & linting (#37159)
    • 0d40674 fix(deps): update minor and patch dependencies for gatsby-plugin-mdx (#37154)
    • 11efd36 chore(release): Publish next
    • 30c8c61 chore(changelogs): update changelogs (#37106)
    • 7c27b0d chore(release): Publish next pre-minor
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • build(deps): bump gatsby-transformer-remark from 5.21.0 to 5.25.1 in /docs

    build(deps): bump gatsby-transformer-remark from 5.21.0 to 5.25.1 in /docs

    Bumps gatsby-transformer-remark from 5.21.0 to 5.25.1.

    Changelog

    Sourced from gatsby-transformer-remark's changelog.

    Changelog: gatsby-transformer-remark

    All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

    6.3.2 (2022-12-20)

    Bug Fixes

    6.3.1 (2022-12-14)

    Note: Version bump only for package gatsby-transformer-remark

    6.3.0 (2022-12-13)

    🧾 Release notes

    Bug Fixes

    • update minor and patch dependencies for gatsby-transformer-remark #37164 (b7d1db7)

    6.2.0 (2022-11-25)

    🧾 Release notes

    Other Changes

    6.1.0 (2022-11-22)

    🧾 Release notes

    Note: Version bump only for package gatsby-transformer-remark

    6.0.0 (2022-11-08)

    🧾 Release notes

    Chores

    5.24.0 (2022-09-27)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • build(deps): bump gatsby-remark-mermaid from 2.1.0 to 3.0.1 in /docs

    build(deps): bump gatsby-remark-mermaid from 2.1.0 to 3.0.1 in /docs

    Bumps gatsby-remark-mermaid from 2.1.0 to 3.0.1.

    Release notes

    Sourced from gatsby-remark-mermaid's releases.

    v3.0.1

    • Pass a vfile to remark-mermaidjs.
    • Expose package.json through package exports.

    v3.0.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/remcohaszing/gatsby-remark-mermaid/compare/v2.1.0...v3.0.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • build(deps): bump d3-color and gatsby-remark-mermaid in /docs

    build(deps): bump d3-color and gatsby-remark-mermaid in /docs

    Bumps d3-color to 3.1.0 and updates ancestor dependency gatsby-remark-mermaid. These dependencies need to be updated together.

    Updates d3-color from 1.4.1 to 3.1.0

    Release notes

    Sourced from d3-color's releases.

    v3.1.0

    v3.0.1

    • Make build reproducible.

    v3.0.0

    • Adopt type: module.

    This package now requires Node.js 12 or higher. For more, please read Sindre Sorhus’s FAQ.

    v2.0.0

    This release adopts ES2015 language features such as for-of and drops support for older browsers, including IE. If you need to support pre-ES2015 environments, you should stick with d3-color 1.x or use a transpiler.

    Commits

    Updates gatsby-remark-mermaid from 2.1.0 to 3.0.1

    Release notes

    Sourced from gatsby-remark-mermaid's releases.

    v3.0.1

    • Pass a vfile to remark-mermaidjs.
    • Expose package.json through package exports.

    v3.0.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/remcohaszing/gatsby-remark-mermaid/compare/v2.1.0...v3.0.0

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
  • typecheck: support Go 1.20

    typecheck: support Go 1.20

    Your feature request related to a problem? Please describe.

    I tried to run linters that pass now, on go 1.20rc1, but some are failing suspiciously in typecheck.

    For example, certain exported symbols in the same package show up as undeclared.

    imports/go/gojs.go:30:32: undeclared name: `RoundTripperKey` (typecheck)
    	return context.WithValue(ctx, RoundTripperKey{}, rt)
    	                              ^
    

    Another example, is it seems you have to add return after a panic now?

            panic(fmt.Sprintf("TODO: fetchPromise.%s", method))
    +       return nil, nil
    

    I stopped here

    Describe the solution you'd like.

    I would like to be able to test release candidates

    Describe alternatives you've considered.

    waiting

    Additional context.

    I installed go using gimme 1.20rc1 and ran make lint on https://github.com/tetratelabs/wazero

Run linters from Go code -

Lint - run linters from Go Lint makes it easy to run linters from Go code. This allows lint checks to be part of a regular go build + go test workflow

Sep 27, 2022
Custom linters

Raftt Raftt linters This package contains Go linters for use in Raftt projects. Linters discardedreturn This linter checks for discarded return values

Dec 5, 2021
A little fast cloc(Count Lines Of Code)

gocloc A little fast cloc(Count Lines Of Code), written in Go. Inspired by tokei. Installation $ go get -u github.com/hhatto/gocloc/cmd/gocloc Usage

Jan 6, 2023
Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go

Sloc Cloc and Code (scc) A tool similar to cloc, sloccount and tokei. For counting physical the lines of code, blank lines, comment lines, and physica

Jan 4, 2023
Fast division, modulus and divisibility checks in Go for divisors known only at runtime.

fastdiv Fast division, modulus and divisibility checks for divisors known only at runtime via the method of: "Faster Remainder by Direct Computation:

Jan 8, 2023
Bundle k6 with extensions as fast and easily as possible

xk6bundler xk6bundler is a CLI tool and GitHub Action makes bundle k6 with extensions as fast and easily as possible. Features Build for multiple targ

Nov 29, 2022
Fast linters Runner for Go
Fast linters Runner for Go

golangci-lint Fast linters runner for Go golangci-lint is a fast Go linters runner. It runs linters in parallel, uses caching, supports yaml config, h

Jan 8, 2023
Run linters from Go code -

Lint - run linters from Go Lint makes it easy to run linters from Go code. This allows lint checks to be part of a regular go build + go test workflow

Sep 27, 2022
A simple terminal UI for Go linters
A simple terminal UI for Go linters

golintui golintui is a TUI tool that helps you run various kinds of linters with ease and organize its results, with the power of golangci-lint. Cool

Jun 9, 2022
Custom linters

Raftt Raftt linters This package contains Go linters for use in Raftt projects. Linters discardedreturn This linter checks for discarded return values

Dec 5, 2021
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.

#1 Golang live reload and task runner Content - ⭐️ Top Features - ???? Get started - ?? Config sample - ?? Commands List - ?? Support and Suggestions

Jan 6, 2023
Concurrent task runner, developer's routine tasks automation toolkit. Simple modern alternative to GNU Make 🧰
Concurrent task runner, developer's routine tasks automation toolkit. Simple modern alternative to GNU Make 🧰

taskctl - concurrent task runner, developer's routine tasks automation toolkit Simple modern alternative to GNU Make. taskctl is concurrent task runne

Dec 14, 2022
:runner:runs go generate recursively on a specified path or environment variable and can filter by regex

Package generate Package generate runs go generate recursively on a specified path or environment variable like $GOPATH and can filter by regex Why wo

Sep 27, 2022
Docker-based remote code runner / 基于 Docker 的远程代码运行器
Docker-based remote code runner / 基于 Docker 的远程代码运行器

Docker-based remote code runner / 基于 Docker 的远程代码运行器

Nov 9, 2022
🏠 An HTTP-based command runner for home automation.
🏠 An HTTP-based command runner for home automation.

Badges Reporting Issues If you are facing a problem with this package or found any bug, please open an issue on GitHub. License The MIT License (MIT).

Oct 29, 2022
Build system and task runner for Go projects
Build system and task runner for Go projects

Gilbert is task runner that aims to provide declarative way to define and run tasks like in other projects like Gradle, Maven and etc.

Dec 21, 2022
Go based task runner

Grift Grift is a very simple library that allows you to write simple "task" scripts in Go and run them by name without having to write big main type o

Nov 21, 2022
Nodebook - Multi-Lang Web REPL + CLI Code runner
Nodebook - Multi-Lang Web REPL + CLI Code runner

nodebook Nodebook - Multi-Language REPL with Web UI + CLI code runner Useful to practice algorithms and datastructures for coding interviews. What is

Dec 29, 2022
'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.

gotestsum gotestsum runs tests using go test --json, prints formatted test output, and a summary of the test run. It is designed to work well for both

Dec 28, 2022
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.

#1 Golang live reload and task runner Content - ⭐️ Top Features - ???? Get started - ?? Config sample - ?? Commands List - ?? Support and Suggestions

Dec 31, 2022