Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename wire_gen file and add makefile #199

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading