File: check_go_lint.sh

package info (click to toggle)
golang-github-golang-mock 1.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, forky, sid, trixie
  • size: 800 kB
  • sloc: sh: 58; makefile: 3
file content (17 lines) | stat: -rwxr-xr-x 441 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# This script is used by CI to check if the code passes golint.

set -u

if ! command -v golint >/dev/null; then
    echo "error: golint not found; go get -u golang.org/x/lint/golint" >&2
    exit 1
fi

GOLINT_OUTPUT=$(IFS=$'\n'; golint ./... | grep -v "mockgen/internal/.*\|sample/.*")
if [[ -n "${GOLINT_OUTPUT}" ]]; then
    echo "${GOLINT_OUTPUT}"
    echo
    echo "The go source files aren't passing golint."
    exit 1
fi