Skip to content

Commit 6ad3fe7

Browse files
authored
Rename wire_gen file and add makefile (#199)
* Rename wire_gen file and add makefile * update go mod
1 parent e501d86 commit 6ad3fe7

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-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

0 commit comments

Comments
 (0)