Skip to content

Commit 747b3f4

Browse files
committed
chore: add Makefile and formatting
1 parent 9e4d93c commit 747b3f4

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ lint:
4343
./scripts/lint.sh
4444

4545
test:
46-
go test -v -race -cover $(PKGS)
46+
CGO_ENABLED=1 go test -v -race -cover $(PKGS)
4747

4848
test-coverage:
49-
go test -coverprofile=coverage.out $(PKGS)
49+
CGO_ENABLED=1go test -coverprofile=coverage.out $(PKGS)
5050
go tool cover -func=coverage.out
5151
go tool cover -html=coverage.out -o coverage.html
5252

formatting/run.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash -e
2+
3+
while getopts i: flag
4+
do
5+
case "${flag}" in
6+
i) INPUT_DIR=${OPTARG};;
7+
esac
8+
done
9+
10+
while getopts i: flag
11+
do
12+
case "${flag}" in
13+
i) INPUT_DIR=${OPTARG};;
14+
esac
15+
done
16+
17+
go run golang.org/x/tools/cmd/goimports@latest -w $INPUT_DIR || { echo "Failed to clean imports in $INPUT_DIR"; exit 1; }
18+
19+
echo "Import cleaning completed."

0 commit comments

Comments
 (0)