Skip to content

Commit

Permalink
Rename wire_gen file and add makefile (#199)
Browse files Browse the repository at this point in the history
* Rename wire_gen file and add makefile

* update go mod
  • Loading branch information
Yiling-J authored Dec 6, 2024
1 parent e501d86 commit 6ad3fe7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.PHONY: test lint cover mock_wire mock_gen

test:
go test ./...

lint:
golangci-lint run

cover:
go test -coverprofile=cover.out -coverpkg=./... ./...
go tool cover -html=cover.out -o cover.html
open cover.html

mock_wire:
@echo "Running wire for component mocks..."
@go run -mod=mod github.com/google/wire/cmd/wire opencsg.com/csghub-server/component
@if [ $$? -eq 0 ]; then \
echo "Renaming wire_gen.go to wire_gen_test.go..."; \
mv component/wire_gen.go component/wire_gen_test.go; \
else \
echo "Wire failed, skipping renaming."; \
fi

mock_gen:
mockery
File renamed without changes.

0 comments on commit 6ad3fe7

Please sign in to comment.