Skip to content

Commit 866a79c

Browse files
committed
Rename wire_gen file and add makefile
1 parent 06a1793 commit 866a79c

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.PHONY: test lint cover mock_wire mock_gen
2+
3+
test:
4+
go test ./...
5+
6+
lint:
7+
golangci-lint run
8+
9+
cover:
10+
go test -coverprofile=cover.out -coverpkg=./... ./...
11+
go tool cover -html=cover.out -o cover.html
12+
open cover.html
13+
14+
mock_wire:
15+
@echo "Running wire for component mocks..."
16+
@go run -mod=mod github.com/google/wire/cmd/wire opencsg.com/csghub-server/component
17+
@if [ $$? -eq 0 ]; then \
18+
echo "Renaming wire_gen.go to wire_gen_test.go..."; \
19+
mv component/wire_gen.go component/wire_gen_test.go; \
20+
else \
21+
echo "Wire failed, skipping renaming."; \
22+
fi
23+
24+
mock_gen:
25+
mockery

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2
303303
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
304304
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
305305
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
306+
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
306307
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
307308
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
308309
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=

0 commit comments

Comments
 (0)