Skip to content
check-circle

GitHub Action

Check Golang imports order

v1.0.3 Latest version

Check Golang imports order

check-circle

Check Golang imports order

Check imports order of your code using goimports

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Check Golang imports order

uses: Jerome1337/[email protected]

Learn more about this action in Jerome1337/goimports-action

Choose a version

Go Imports Action

This action execute goimports command and return the output if the command fail.

Inputs

goimports-path

Path where your Go files are. This path will be used by goimports command to check imports of this files.

Default one is the repository root (./).

Outputs

goimports-output

The goimports output if the command fail.

For Example:

All following has imports not properly ordered
handlers/writer.go
services/writer/writerServices.go

Example Usage

uses: Jerome1337/[email protected]
with:
  goimports-path: './src'