File: run-checks

package info (click to toggle)
golang-github-mvo5-uboot-go 0.4%2Bgit256976a-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 84 kB
  • sloc: sh: 32; makefile: 6
file content (48 lines) | stat: -rwxr-xr-x 691 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

set -e

if which goctest >/dev/null; then
    goctest="goctest"
else
    goctest="go test"
fi

echo Checking formatting
fmt="$(gofmt -l .)"

if [ -n "$fmt" ]; then
    echo "Formatting wrong in following files"
    echo "$fmt"
    exit 1
fi

echo Installing godeps
go get launchpad.net/godeps
export PATH=$PATH:$GOPATH/bin

echo Install golint
go get github.com/golang/lint/golint
export PATH=$PATH:$GOPATH/bin

echo Building
go build -v .


# tests
echo Running tests from $(pwd)
$goctest -v -cover ./...


# go vet
echo Running vet
go vet ./...

# golint
echo Running lint
lint="$(golint ./...)"
if [ -n "$lint" ]; then
    echo "Lint complains:"
    echo "$lint"
    exit 1
fi