7

GitHub - weijiangan/flycheck-golangci-lint: Flycheck checker for golangci-lint

 3 years ago
source link: https://github.com/weijiangan/flycheck-golangci-lint
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

flycheck-golangci-lint

Flycheck checker for golangci-lint

Install

MELPA

M-x package-install flycheck-golangci-lint

Manual

M-x package-install-file

Usage

Add the following lines to your config

(eval-after-load 'flycheck                                       
  '(add-hook 'flycheck-mode-hook #'flycheck-golangci-lint-setup))

If you have use-package installed

(use-package flycheck-golangci-lint
  :ensure t
  :hook (go-mode . flycheck-golangci-lint-setup))

Available options

--config (default: nil)

(setq flycheck-golangci-lint-config "path/to/config")

--deadline (default: 1m)

(setq flycheck-golangci-lint-deadline "1m")

--tests (default: nil)

(setq flycheck-golangci-lint-tests t)

--fast (default: nil)

(setq flycheck-golangci-lint-fast t)

--enable-all (default: nil)

(setq flycheck-golangci-lint-enable-all t)

--disable-all (default: nil)

(setq flycheck-golangci-lint-disable-all t)

--enable= (default: nil)

(setq flycheck-golangci-lint-enable-linters '("lll" "structcheck"))

--disable= (default: nil)

(setq flycheck-golangci-lint-disable-linters '("unused" "staticcheck" "misspell"))

GO Modules

Make sure you have set GO111MODULE, if it's not the default in your Go version.

(setenv "GO111MODULE" "on")

Contribute

Pull requests are welcomed :)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK