github.com/alecthomas/golangci-lint@v1.4.2-0.20180609094924-581a3564ff68/README.md (about)

     1  # GolangCI-Lint
     2  [![Build Status](https://travis-ci.com/golangci/golangci-lint.svg?branch=master)](https://travis-ci.com/golangci/golangci-lint)
     3  
     4  GolangCI-Lint is a linters aggregator. It's fast: on average [5 times faster](#performance) than gometalinter. It's [easy to integrate and use](#issues-options), has [nice output](#quick-start) and has a minimum number of false positives.
     5  
     6  GolangCI-Lint has [integrations](#editor-integration) with VS Code, GNU Emacs, Sublime Text.
     7  
     8  Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running linters on Github pull requests. Free for Open Source.
     9  
    10  <a href="https://golangci.com/"><img src="docs/go.png" width="250px"></a>
    11  
    12     * [Demo](#demo)
    13     * [Install](#install)
    14     * [Quick Start](#quick-start)
    15     * [Editor Integration](#editor-integration)
    16     * [Comparison](#comparison)
    17     * [Performance](#performance)
    18     * [Supported Linters](#supported-linters)
    19     * [Configuration](#configuration)
    20     * [False Positives](#false-positives)
    21     * [Internals](#internals)
    22     * [FAQ](#faq)
    23     * [Thanks](#thanks)
    24     * [Future Plans](#future-plans)
    25     * [Contact Information](#contact-information)
    26  
    27  # Demo
    28  <p align="center">
    29    <img src="./docs/demo.svg" width="100%">
    30  </p>
    31  
    32  Short 1.5 min video demo of analyzing [beego](https://github.com/astaxie/beego).
    33  [![asciicast](https://asciinema.org/a/183662.png)](https://asciinema.org/a/183662)
    34  
    35  # Install
    36  ## CI Installation
    37  Most installations are done for CI (travis, circleci etc). It's important to have reproducible CI:
    38  don't start to fail all builds at the same time. With golangci-lint this can happen if you
    39  use `--enable-all` and a new linter is added or even without `--enable-all`: when one upstream linter
    40  is upgraded.
    41  
    42  It's highly recommended to install a fixed version of golangci-lint.
    43  Releases are available on the [releases page](https://github.com/golangci/golangci-lint/releases).
    44  
    45  The recommended way to install golangci-lint:
    46  ```bash
    47  curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s VERSION
    48  ```
    49  
    50  Periodically update version of golangci-lint: the project is under active development
    51  and is constantly being improved. But please always check for newly found issues and
    52  update if needed.
    53  
    54  ## Local Installation
    55  It's a not recommended for your CI pipeline. Only install like this for your local development environment.
    56  ```bash
    57  go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
    58  ```
    59  
    60  You can also install it on OSX using brew:
    61  ```bash
    62  brew install golangci/tap/golangci-lint
    63  brew upgrade golangci/tap/golangci-lint
    64  ```
    65  
    66  # Quick Start
    67  To run golangci-lint execute:
    68  ```bash
    69  golangci-lint run
    70  ```
    71  
    72  It's an equivalent of executing:
    73  ```bash
    74  golangci-lint run ./...
    75  ```
    76  
    77  You can choose which directories and files to analyze:
    78  ```bash
    79  golangci-lint run dir1 dir2/... dir3/file1.go
    80  ```
    81  Directories are NOT analyzed recursively. To analyze them recursively append `/...` to their path.
    82  
    83  GolangCI-Lint can be used with zero configuration. By default the following linters are enabled:
    84  ```
    85  $ golangci-lint linters
    86  Enabled by default linters:
    87  govet: Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: true]
    88  errcheck: Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false]
    89  staticcheck: Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false]
    90  unused: Checks Go code for unused constants, variables, functions and types [fast: false]
    91  gosimple: Linter for Go source code that specializes in simplifying a code [fast: false]
    92  gas: Inspects source code for security problems [fast: false]
    93  structcheck: Finds an unused struct fields [fast: false]
    94  varcheck: Finds unused global variables and constants [fast: false]
    95  ineffassign: Detects when assignments to existing variables are not used [fast: true]
    96  deadcode: Finds unused code [fast: false]
    97  typecheck: Like the front-end of a Go compiler, parses and type-checks Go code [fast: false]
    98  ```
    99  
   100  and the following linters are disabled by default:
   101  ```
   102  $ golangci-lint linters
   103  ...
   104  Disabled by default linters:
   105  golint: Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true]
   106  interfacer: Linter that suggests narrower interface types [fast: false]
   107  unconvert: Remove unnecessary type conversions [fast: false]
   108  dupl: Tool for code clone detection [fast: true]
   109  goconst: Finds repeated strings that could be replaced by a constant [fast: true]
   110  gocyclo: Computes and checks the cyclomatic complexity of functions [fast: true]
   111  gofmt: Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true]
   112  goimports: Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true]
   113  maligned: Tool to detect Go structs that would take less memory if their fields were sorted [fast: false]
   114  megacheck: 3 sub-linters in one: unused, gosimple and staticcheck [fast: false]
   115  depguard: Go linter that checks if package imports are in a list of acceptable packages [fast: false]
   116  ```
   117  
   118  Pass `-E/--enable` to enable linter and `-D/--disable` to disable:
   119  ```bash
   120  $ golangci-lint run --disable-all -E errcheck
   121  ```
   122  
   123  # Editor Integration
   124  1. [Go for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go).
   125  2. Sublime Text - [plugin](https://github.com/alecthomas/SublimeLinter-contrib-golang-cilint) for SublimeLinter.
   126  3. GoLand
   127    - Configure [File Watcher](https://www.jetbrains.com/help/go/settings-tools-file-watchers.html) with arguments `run --print-issued-lines=false $FileDir$`.
   128    - Predefined File Watcher will be added in [issue](https://youtrack.jetbrains.com/issue/GO-4574).
   129  4. GNU Emacs - [flycheck checker](https://github.com/weijiangan/flycheck-golangci-lint).
   130  5. Vim - [issue](https://github.com/fatih/vim-go/issues/1841) for vim-go.
   131  
   132  # Comparison
   133  ## `golangci-lint` vs `gometalinter`
   134  GolangCI-Lint was created to fix the following issues with `gometalinter`:
   135  1. Slow work: `gometalinter` usually works for minutes in average projects. **GolangCI-Lint works [2-7x times faster](#performance)** by [reusing work](#internals).
   136  2. Huge memory consumption: parallel linters don't share the same program representation and can consume `n` times more memory (`n` - concurrency). GolangCI-Lint fixes it by sharing representation and **consumes 1.35x less memory**.
   137  3. Doesn't use real bounded concurrency: if you set it to `n` it can take up to `n*n` threads because of forced threads in specific linters. `gometalinter` can't do anything about it because it runs linters as black boxes in forked processes. In GolangCI-Lint we run all linters in one process and completely control them. Configured concurrency will be correctly bounded.
   138  This issue is important because you often want to set concurrency to the CPUs count minus one to ensure you **do not freeze your PC** and be able to work on it while analyzing code.
   139  4. Lack of nice output. We like how the `gcc` and `clang` compilers format their warnings: **using colors, printing warning lines and showing the position in line**.
   140  5. Too many issues. GolangCI-Lint cuts a lot of issues by using default exclude list of common false-positives. By default, it has enabled **smart issues processing**: merge multiple issues for one line, merge issues with the same text or from the same linter. All of these smart processors can be configured by the user.
   141  6. Integration into large codebases. A good way to start using linters in a large project is not to fix a plethora of existing issues, but to set up CI and **fix only issues in new commits**. You can use `revgrep` for it, but it's yet another utility to install and configure. With `golangci-lint` it's much easier: `revgrep` is already built into `golangci-lint` and you can use it with one option (`-n, --new` or `--new-from-rev`).
   142  7. Installation. With `gometalinter`, you need to run a linters installation step. It's easy to forget this step and end up with stale linters. It also complicates CI setup. GolangCI-Lint requires **no installation of linters**.
   143  8. **Yaml or toml config**. Gometalinter's JSON isn't convenient for config files.
   144  
   145  ## `golangci-lint` vs Running Linters Manually
   146  1. It will be much slower because `golangci-lint` runs all linters in parallel and shares 50-80% of linters work.
   147  2. It will have less control and more false-positives: some linters can't be properly configured without hacks.
   148  3. It will take more time because of different usages and need of tracking of versions of `n` linters.
   149  
   150  # Performance
   151  Benchmarks were executed on MacBook Pro (Retina, 13-inch, Late 2013), 2,4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
   152  It has 4 cores and concurrent linting as a default consuming all cores.
   153  Benchmark was run (and measured) automatically, see the code
   154  [here](https://github.com/golangci/golangci-lint/blob/master/test/bench_test.go) (`BenchmarkWithGometalinter`).
   155  
   156  We measure peak memory usage (RSS) by tracking of processes RSS every 5 ms.
   157  
   158  ## Comparison with gometalinter
   159  We compare golangci-lint and gometalinter in default mode, but explicitly enable all linters because of small differences in the default configuration.
   160  ```bash
   161  $ golangci-lint run --no-config --issues-exit-code=0 --deadline=30m \
   162  	--disable-all --enable=deadcode  --enable=gocyclo --enable=golint --enable=varcheck \
   163  	--enable=structcheck --enable=maligned --enable=errcheck --enable=dupl --enable=ineffassign \
   164  	--enable=interfacer --enable=unconvert --enable=goconst --enable=gas --enable=megacheck
   165  $ gometalinter --deadline=30m --vendor --cyclo-over=30 --dupl-threshold=150 \
   166  	--exclude=<defaul golangci-lint excludes> --skip=testdata --skip=builtin \
   167  	--disable-all --enable=deadcode  --enable=gocyclo --enable=golint --enable=varcheck \
   168  	--enable=structcheck --enable=maligned --enable=errcheck --enable=dupl --enable=ineffassign \
   169  	--enable=interfacer --enable=unconvert --enable=goconst --enable=gas --enable=megacheck
   170  	./...
   171  ```
   172  
   173  | Repository | GolangCI Time | GolangCI Is Faster than Gometalinter | GolangCI Memory | GolangCI eats less memory than Gometalinter |
   174  | ---------- | ------------- | ------------------------------------ | --------------- | ------------------------------------------- |
   175  | gometalinter repo, 4 kLoC   | 6s    | **6.4x** | 0.7GB | 1.5x |
   176  | self-repo, 4 kLoC           | 12s   | **7.5x** | 1.2GB | 1.7x |
   177  | beego, 50 kLoC              | 10s   | **4.2x** | 1.4GB | 1.1x |
   178  | hugo, 70 kLoC               | 15s   | **6.1x** | 1.6GB | 1.8x |
   179  | consul, 127 kLoC            | 58s   | **4x**   | 2.7GB | 1.7x |
   180  | terraform, 190 kLoC         | 2m13s | **1.6x** | 4.8GB | 1x   |
   181  | go-ethereum, 250 kLoC       | 33s   | **5x**   | 3.6GB | 1x   |
   182  | go source, 1300 kLoC        | 2m45s | **2x**   | 4.7GB | 1x   |
   183  
   184  
   185  **On average golangci-lint is 4.6 times faster** than gometalinter. Maximum difference is in the
   186  self-repo: **7.5 times faster**, minimum difference is in terraform source code repo: 1.8 times faster.
   187  
   188  On average golangci-lint consumes 1.35 times less memory.
   189  
   190  # Supported Linters
   191  To see a list of supported linters and which linters are enabled/disabled:
   192  ```
   193  golangci-lint linters
   194  ```
   195  
   196  ## Enabled By Default Linters
   197  - [govet](https://golang.org/cmd/vet/) - Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
   198  - [errcheck](https://github.com/kisielk/errcheck) - Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
   199  - [staticcheck](https://staticcheck.io/) - Staticcheck is a go vet on steroids, applying a ton of static analysis checks
   200  - [unused](https://github.com/dominikh/go-tools/tree/master/cmd/unused) - Checks Go code for unused constants, variables, functions and types
   201  - [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) - Linter for Go source code that specializes in simplifying a code
   202  - [gas](https://github.com/GoASTScanner/gas) - Inspects source code for security problems
   203  - [structcheck](https://github.com/opennota/check) - Finds an unused struct fields
   204  - [varcheck](https://github.com/opennota/check) - Finds unused global variables and constants
   205  - [ineffassign](https://github.com/gordonklaus/ineffassign) - Detects when assignments to existing variables are not used
   206  - [deadcode](https://github.com/remyoudompheng/go-misc/tree/master/deadcode) - Finds unused code
   207  - typecheck - Like the front-end of a Go compiler, parses and type-checks Go code
   208  
   209  ## Disabled By Default Linters (`-E/--enable`)
   210  - [golint](https://github.com/golang/lint) - Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
   211  - [interfacer](https://github.com/mvdan/interfacer) - Linter that suggests narrower interface types
   212  - [unconvert](https://github.com/mdempsky/unconvert) - Remove unnecessary type conversions
   213  - [dupl](https://github.com/mibk/dupl) - Tool for code clone detection
   214  - [goconst](https://github.com/jgautheron/goconst) - Finds repeated strings that could be replaced by a constant
   215  - [gocyclo](https://github.com/alecthomas/gocyclo) - Computes and checks the cyclomatic complexity of functions
   216  - [gofmt](https://golang.org/cmd/gofmt/) - Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
   217  - [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - Goimports does everything that gofmt does. Additionally it checks unused imports
   218  - [maligned](https://github.com/mdempsky/maligned) - Tool to detect Go structs that would take less memory if their fields were sorted
   219  - [megacheck](https://github.com/dominikh/go-tools/tree/master/cmd/megacheck) - 3 sub-linters in one: unused, gosimple and staticcheck
   220  - [depguard](https://github.com/OpenPeeDeeP/depguard) - Go linter that checks if package imports are in a list of acceptable packages
   221  
   222  # Configuration
   223  The config file has lower priority than command-line options. If the same bool/string/int option is provided on the command-line
   224  and in the config file, the option from command-line will be used.
   225  Slice options (e.g. list of enabled/disabled linters) are combined from the command-line and config file.
   226  
   227  ## Command-Line Options
   228  ```
   229  golangci-lint run -h
   230  Usage:
   231    golangci-lint run [flags]
   232  
   233  Flags:
   234        --out-format string           Format of output: colored-line-number|line-number|json|tab (default "colored-line-number")
   235        --print-issued-lines          Print lines of code with issue (default true)
   236        --print-linter-name           Print linter name in issue line (default true)
   237        --issues-exit-code int        Exit code when issues were found (default 1)
   238        --build-tags strings          Build tags (not all linters support them)
   239        --deadline duration           Deadline for total work (default 1m0s)
   240        --tests                       Analyze tests (*_test.go) (default true)
   241        --print-resources-usage       Print avg and max memory usage of golangci-lint and total time
   242    -c, --config PATH                 Read config from file path PATH
   243        --no-config                   Don't read config
   244        --skip-dirs strings           Regexps of directory names to skip
   245        --skip-files strings          Regexps of file names to skip
   246    -E, --enable strings              Enable specific linter
   247    -D, --disable strings             Disable specific linter
   248        --enable-all                  Enable all linters
   249        --disable-all                 Disable all linters
   250    -p, --presets strings             Enable presets (bugs|unused|format|style|complexity|performance) of linters. Run 'golangci-lint linters' to see them. This option implies option --disable-all
   251        --fast                        Run only fast linters from enabled linters set
   252    -e, --exclude strings             Exclude issue by regexp
   253        --exclude-use-default         Use or not use default excludes:
   254                                        # errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
   255                                        - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
   256                                      
   257                                        # golint: Annoying issue about not having a comment. The rare codebase has such comments
   258                                        - (should have comment|comment on exported method|should have a package comment)
   259                                      
   260                                        # golint: False positive when tests are defined in package 'test'
   261                                        - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this
   262                                      
   263                                        # gas: Too many false-positives on 'unsafe' usage
   264                                        - Use of unsafe calls should be audited
   265                                      
   266                                        # gas: Too many false-positives for parametrized shell calls
   267                                        - Subprocess launch(ed with variable|ing should be audited)
   268                                      
   269                                        # gas: Duplicated errcheck checks
   270                                        - G104
   271                                      
   272                                        # gas: Too many issues in popular repos
   273                                        - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
   274                                      
   275                                        # gas: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
   276                                        - Potential file inclusion via variable
   277                                      
   278                                        # govet: Common false positives
   279                                        - (possible misuse of unsafe.Pointer|should have signature)
   280                                      
   281                                        # megacheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore
   282                                        - ineffective break statement. Did you mean to break out of the outer loop
   283                                       (default true)
   284        --max-issues-per-linter int   Maximum issues count per one linter. Set to 0 to disable (default 50)
   285        --max-same-issues int         Maximum count of issues with the same text. Set to 0 to disable (default 3)
   286    -n, --new                         Show only new issues: if there are unstaged changes or untracked files, only those changes are analyzed, else only changes in HEAD~ are analyzed.
   287                                      It's a super-useful option for integration of golangci-lint into existing large codebase.
   288                                      It's not practical to fix all existing issues at the moment of integration: much better don't allow issues in new code
   289        --new-from-rev REV            Show only new issues created after git revision REV
   290        --new-from-patch PATH         Show only new issues created in git patch with file path PATH
   291    -h, --help                        help for run
   292  
   293  Global Flags:
   294    -j, --concurrency int           Concurrency (default NumCPU) (default 8)
   295        --cpu-profile-path string   Path to CPU profile output file
   296        --mem-profile-path string   Path to memory profile output file
   297    -v, --verbose                   verbose output
   298  
   299  ```
   300  
   301  ## Config File
   302  GolangCI-Lint looks for config files in the following paths from the current working directory:
   303  - `.golangci.yml`
   304  - `.golangci.toml`
   305  - `.golangci.json`
   306  
   307  GolangCI-Lint also searches for config files in all directories from the directory of the first analyzed path up to the root.
   308  To see which config file is being used and where it was sourced from run golangci-lint with `-v` option.
   309  
   310  Config options inside the file are identical to command-line options.
   311  You can configure specific linters' options only within the config file (not the command-line).
   312  
   313  There is a [`.golangci.yml`](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) example config file with all supported options.
   314  
   315  It's a [.golangci.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.yml) config file of this repo: we enable more linters
   316  than the default and more strict settings:
   317  ```yaml
   318  linters-settings:
   319    govet:
   320      check-shadowing: true
   321    golint:
   322      min-confidence: 0
   323    gocyclo:
   324      min-complexity: 10
   325    maligned:
   326      suggest-new: true
   327    dupl:
   328      threshold: 100
   329    goconst:
   330      min-len: 2
   331      min-occurrences: 2
   332  
   333  linters:
   334    enable-all: true
   335    disable:
   336      - maligned
   337  ```
   338  
   339  # False Positives
   340  False positives are inevitable, but we did our best to reduce their count. For example, we have a default enabled set of [exclude patterns](#issues-options). If a false positive occurred you have the following choices:
   341  1. Exclude issue by text using command-line option `-e` or config option `issues.exclude`. It's helpful when you decided to ignore all issues of this type.
   342  2. Exclude this one issue by using special comment `// nolint[:linter1,linter2,...]` on issued line.
   343  Comment `// nolint` disables all issues reporting on this line. Comment e.g. `// nolint:govet` disables only govet issues for this line.
   344  If you would like to completely exclude all issues for some function prepend this comment
   345  above function:
   346  ```go
   347  //nolint
   348  func f() {
   349    ...
   350  }
   351  ```
   352  
   353  Please create [GitHub Issues here](https://github.com/golangci/golangci-lint/issues/new) if you find any false positives. We will add it to the default exclude list if it's common or we will fix underlying linter.
   354  
   355  # Internals
   356  The key difference with gometalinter is that golangci-lint shares work between specific linters (golint, govet, ...).
   357  For small and medium projects 50-80% of work between linters can be reused.
   358  Now we share `loader.Program` and `SSA` representation building. `SSA` representation is used from
   359  a [fork of go-tools](https://github.com/dominikh/go-tools), not the official one. Also, we are going to
   360  reuse `AST` parsing and traversal.
   361  
   362  We don't fork to call specific linter but use its API. We forked GitHub repos of almost all linters
   363  to make API. It also allows us to be more performant and control actual count of used threads.
   364  
   365  All linters are vendored in the `/vendor` folder: their version is fixed, they are builtin
   366  and you don't need to install them separately.
   367  
   368  We use chains for issues and independent processors to post-process them: exclude issues by limits,
   369  nolint comment, diff, regexps; prettify paths, etc.
   370  
   371  We use `cobra` for command-line options.
   372  
   373  # FAQ
   374  **Q: How do you add a custom linter?**
   375  
   376  A: You can integrate it yourself, see this [wiki page](https://github.com/golangci/golangci-lint/wiki/How-to-add-a-custom-linter) with documentation. Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
   377  
   378  **Q: It's cool to use `golangci-lint` when starting a project, but what about existing projects with large codebase? It will take days to fix all found issues**
   379  
   380  A: We are sure that every project can easily integrate `golangci-lint`, even the large one. The idea is to not fix all existing issues. Fix only newly added issue: issues in new code. To do this setup CI (or better use [GolangCI](https://golangci.com) to run `golangci-lint` with option `--new-from-rev=origin/master`. Also, take a look at option `-n`.
   381  By doing this you won't create new issues in your code and can choose fix existing issues (or not).
   382  
   383  **Q: How to use `golangci-lint` in CI (Continuous Integration)?**
   384  
   385  A: You have 2 choices:
   386  1. Use [GolangCI](https://golangci.com): this service is highly integrated with GitHub (issues are commented in the pull request) and uses a `golangci-lint` tool. For configuration use `.golangci.yml` (or toml/json).
   387  2. Use custom CI: just run `golangci-lint` in CI and check the exit code. If it's non-zero - fail the build. The main disadvantage is that you can't see issues in pull request code and would need to view the build log, then open the referenced source file to see the context.
   388  If you'd like to vendor `golangci-lint` in your repo, run:
   389  ```bash
   390  go get -u github.com/golang/dep/cmd/dep
   391  dep init
   392  dep ensure -v -add github.com/golangci/golangci-lint/cmd/golangci-lint
   393  ```
   394  Then add these lines to your `Gopkg.toml` file, so `dep ensure -update` won't delete the vendored `golangci-lint` code.
   395  ```toml
   396  required = [
   397    "github.com/golangci/golangci-lint/cmd/golangci-lint",
   398  ]
   399  ```
   400  In your CI scripts, install the vendored `golangci-lint` like this:
   401  ```bash
   402  go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`
   403  ```
   404  Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
   405  
   406  **Q: `golangci-lint` doesn't work**
   407  1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
   408  2. Run it with `-v` option and check the output.
   409  3. If it doesn't help create a [GitHub issue](https://github.com/golangci/golangci-lint/issues/new) with the output from the error and #2 above.
   410  
   411  # Thanks
   412  Thanks to [alecthomas/gometalinter](https://github.com/alecthomas/gometalinter) for inspiration and amazing work.
   413  Thanks to [bradleyfalzon/revgrep](https://github.com/bradleyfalzon/revgrep) for cool diff tool.
   414  
   415  Thanks to developers and authors of used linters:
   416  - [kisielk](https://github.com/kisielk)
   417  - [golang](https://github.com/golang)
   418  - [dominikh](https://github.com/dominikh)
   419  - [GoASTScanner](https://github.com/GoASTScanner)
   420  - [opennota](https://github.com/opennota)
   421  - [mvdan](https://github.com/mvdan)
   422  - [mdempsky](https://github.com/mdempsky)
   423  - [gordonklaus](https://github.com/gordonklaus)
   424  - [mibk](https://github.com/mibk)
   425  - [jgautheron](https://github.com/jgautheron)
   426  - [remyoudompheng](https://github.com/remyoudompheng)
   427  - [alecthomas](https://github.com/alecthomas)
   428  - [OpenPeeDeeP](https://github.com/OpenPeeDeeP)
   429  
   430  # Future Plans
   431  1. Upstream all changes of forked linters.
   432  2. Fully integrate all used linters: make a common interface and reuse 100% of what can be reused: AST traversal, packages preparation etc.
   433  3. Make it easy to write own linter/checker: it should take a minimum code, have perfect documentation, debugging and testing tooling.
   434  4. Speed up package loading (dig into [loader](golang.org/x/tools/go/loader)): on-disk cache and existing code profiling-optimizing.
   435  5. Analyze (don't only filter) only new code: analyze only changed files and dependencies, make incremental analysis, caches.
   436  6. Smart new issues detector: don't print existing issues on changed lines.
   437  7. Integration with Text Editors. On-the-fly code analysis for text editors: it should be super-fast.
   438  8. Minimize false-positives by fixing linters and improving testing tooling.
   439  9. Automatic issues fixing (code rewrite, refactoring) where it's possible.
   440  10. Documentation for every issue type.
   441  
   442  # Contact Information
   443  You can contact the [author](https://github.com/jirfag) of GolangCI-Lint
   444  by [denis@golangci.com](mailto:denis@golangci.com).