DEV Community

TekWizely
TekWizely

Posted on • Updated on

pre-commit-golang - v1.0.0-beta.4 - Go Mod Tidy, GoFumpt, StaticCheck

Its been a busy week since the v1.0.0-beta.1 announcement.

Here's a quick recap of recent additions:

As an example of invoking custom tools, here's a snippit I gave to a user recently who wanted to invoke golines:

# ...
      hooks:
            # Run 'golines -l --dry-run $FILE' for each staged .go file
        -   id: my-cmd
            name: go-lines
            alias: go-lines
            args: [ golines, -l, --dry-run ]

            # Run 'golines -l --dry-run .' in the repo root folder
        -   id: my-cmd-repo
            name: go-lines-repo
            alias: go-lines-preo
            args: [ golines, -l, --dry-run, . ]
Enter fullscreen mode Exit fullscreen mode

You can read about all pre-commit-golang features on project's homepage:

Top comments (0)