1 { lib, buildGoModule, fetchFromGitHub, go-mockery, runCommand, go }:
7 src = fetchFromGitHub {
11 sha256 = "sha256-8DbUbgzTNcQiCXZFuRPkLiW4PyQLHDo4sN04l1I5rMI=";
15 substituteInPlace ./pkg/generator_test.go --replace-fail 0.0.0-dev ${version}
16 substituteInPlace ./pkg/logging/logging_test.go --replace-fail v0.0 v${lib.versions.majorMinor version}
21 "-X" "github.com/vektra/mockery/v2/pkg/logging.SemVer=v${version}"
27 vendorHash = "sha256-1SzdVM1Ncpym6bPg1aSyfoAM1YiUGal3Glw0paz+buk=";
29 subPackages = [ "." ];
32 generateMock = runCommand "${pname}-test" {
33 nativeBuildInputs = [ go-mockery ];
36 if [[ $(mockery --version) != *"${version}"* ]]; then
37 echo "Error: program version does not match package version"
51 mockery --name Foo --dir .
53 if [[ ! -f "mocks/Foo.go" ]]; then
54 echo "Error: mocks/Foo.go was not generated by ${pname}"
63 homepage = "https://github.com/vektra/mockery";
64 description = "A mock code autogenerator for Golang";
65 maintainers = with maintainers; [ fbrs ];
66 mainProgram = "mockery";
67 license = licenses.bsd3;