Skip to content

martinsaporiti/goimportsorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Imports Order

Go Imports Order is a tool that prevents you from having imports out of order mantaing the company imports (the mod package) at the end of the file.

Installation

go install github.com/martinsaporiti/go-imports-order

Usage

./goimportsorder -pattern=github.com/mycompany/myproject ./...

Also you can analize the imports order of a single file:

./goimportsorder -pattern=github.com/mycompany/myproject ./myproject/myproject.go

Adding as private linter

Run this:

go build -buildmode=plugin -ldflags "-X plaugin.pattern=github.com/mycompany/myproject" plugin.go

then put this in your .golangci.yml:

  custom:
    importsorder:
      path: ./plugin.so
      description: The description of the linter
      original-url: https://github.com/martinsaporiti/goimportsorder

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages