Skip to content

Commit

Permalink
model/DeviceQueryor: use go generate for mock
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Nov 20, 2023
1 parent b7b92b3 commit 14e10ad
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ test: lint

## Generate mocks
gen-mock:
mockgen -source internal/model/model.go -destination internal/fixtures/mock.go -package fixtures
go get go.uber.org/mock@v0.3.0
go generate ./...
go mod tidy

## build-osx
build-osx:
Expand Down
32 changes: 18 additions & 14 deletions internal/fixtures/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ var (
}
)

//go:generate mockgen -source model.go -destination=../fixtures/mock.go -package=fixtures

// DeviceQueryor interface defines methods to query a device.
//
// This is common interface to the ironlib and bmclib libraries.
Expand Down

0 comments on commit 14e10ad

Please sign in to comment.