Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename wire_gen file and add makefile
Browse files Browse the repository at this point in the history
Yiling-J committed Dec 6, 2024
1 parent 06a1793 commit 866a79c
Showing 3 changed files with 26 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.
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -303,6 +303,7 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=

0 comments on commit 866a79c

Please sign in to comment.