Skip to content

Repository files navigation

gomodlint

A linter for go.mod file - validates NO replace directive is committed

Usage in pre-commit hook

if git diff --name-only --cached | grep -q ":\s*go\.mod"; then
  gomodlint
  exit_code=$?
  if [ $exit_code -ne 0 ]; then
    exit $exit_code
  fi
fi

Usage in GitHub Workflow

You should have a Go language installed in your workflow. Then you can use this action as follows:

    - name: go.mod validation
      run: go run github.com/strongo/gomodlint@latest

Free to use & modify - MIT License

Used by:

About

A linter for go.mod file - validates NO `replace` directive is committed

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages