+go.uber.org/mock/mockgen -- GoMock is a mocking framework for the Go programming language

This commit is contained in:
Tobias Germer 2023-10-20 11:15:48 +02:00 committed by Jacob Heider
parent bde580ce10
commit ff6a86cc11
3 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,5 @@
package foo
type Bar interface {
Baz(string) error
}

View file

@ -0,0 +1,3 @@
module example
go 1.20

View file

@ -0,0 +1,34 @@
distributable:
url: git+https://github.com/uber-go/mock
ref: v{{version}}
versions:
github: uber-go/mock
strip: /^v/
dependencies:
go.dev: ^1.20
build:
dependencies:
goreleaser.com: "*"
git-scm.org: "*"
script: |
goreleaser build --clean --single-target --skip=validate
mkdir -p "{{ prefix }}"/bin
mv dist/mock_$PLATFORM/mockgen "{{ prefix }}"/bin
env:
CGO_ENABLED: 0
darwin/aarch64: {PLATFORM: darwin_arm64}
darwin/x86-64: {PLATFORM: darwin_amd64_v1}
linux/aarch64: {PLATFORM: linux_arm64}
linux/x86-64: {PLATFORM: linux_amd64_v1}
provides:
- bin/mockgen
test:
script: |
mockgen --version | grep "v{{version}}"
mockgen -source=foo.go -destination=foo_mock.go
test -f foo_mock.go