Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

GolangCI-Lint integration for IDEA

License

NotificationsYou must be signed in to change notification settings

xxpxxxxp/intellij-plugin-golangci-lint

Repository files navigation

This plugin is moved to JetBrainshttps://plugins.jetbrains.com/plugin/12496-go-linter. May the 4th be with you Gophers!

PublishIssuesLicenseVersion#Download

Intellij/Goland Linter Inspection Plugin

Write code, write better code
All credit goes toGolangCI-Lint authors.

================================

Heads up!

In case of warning:Please make sure no syntax or config error
Please rungo mod tidy to refresh deps

How to use

After the plugin installed, you will see a popup on IDEA startup, otherwise please go to settings manually:

Agolangci-lint executable is required. Choose one from combobox if you already have it in your PATH, orOpen... select one from disk, orGet Latest download one from Github release.

If you have your own.golangci.json|.golangci.toml|.golangci.yaml|.golangci.yml config file, the plugin will detect and use it.
Otherwise, select linters you need:

ClickOK, you are all set!

Please keep in mind thatgolangci-lint is a linter tool,it only works if your project could build (no syntax error), or it will report no issue.

Setting Guide

  • I have a Go project as root project
    The default setting works perfectly
  • I'm using Intellij Ultimate, I have a Go project nested in sub-dir
    SelectProject Root to the Go project path
  • I have multiple Go sub-projects in the root project
    UncheckProject Root.Be aware that only the config file directly under the project root will be used.
  • I want to use a config file not under root project
    SelectUsing config: to the config file

WSL Guide (Windows Subsystem for Linux)

Please make sureGOROOT is set in IDE before config plugin settings.
If you gettypecheck error even with successfulgo build, please installgcc inside WSL:

# Ubuntu/Debiansudo apt install build-essential# Arch/Manjarosudo pacman -S gcc# Red Hat/Fedora/CentOSsudo yum groupinstall'Development Tools'# or with dnfsudo dnf groupinstall'Development Tools'

For Windows Users

Please disablegoimports /gofmt /gci linters. Instead, use Goland orFile-Watcher to format your code.
If you still want to use those 3 linters with the plugin, downloadGNU diff &GNU LibIconv and put them in system PATH (eg: C:\WINDOWS).

Report Bug

  • Please kindly note down your platform (Win/Linux/Mac), IDEA/Goland version and Go version
  • If the plugin reports an error, please also copy-paste the error content

About

GolangCI-Lint integration for IDEA

Topics

Resources

License

Stars

Watchers

Forks

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp