File: lint

package info (click to toggle)
golang-github-ulule-limiter 3.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 240 kB
  • sloc: sh: 114; makefile: 15
file content (25 lines) | stat: -rwxr-xr-x 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

set -eo pipefail

if [[ ! -x "$(command -v go)" ]]; then
  echo >&2 "go runtime is required: https://golang.org/doc/install"
  echo >&2 "You can use scripts/go-wrapper $0 to use go in a docker container."
  exit 1
fi

golinter_path="${GOPATH}/bin/golangci-lint"

if [[ ! -x "${golinter_path}" ]]; then
    go get -u -d github.com/golangci/golangci-lint/cmd/golangci-lint
    go install github.com/golangci/golangci-lint/cmd/golangci-lint
fi

SOURCE_DIRECTORY=$(dirname "${BASH_SOURCE[0]}")
cd "${SOURCE_DIRECTORY}/.."

if [[ -n $1 ]]; then
    golangci-lint run "$1"
else
    golangci-lint run ./...
fi