Repository: vektra/mockery Branch: v3 Commit: 61b1a4512604 Files: 298 Total size: 954.9 KB Directory structure: gitextract_dgckkgnh/ ├── .boilerplate.txt ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ └── bug_report.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ ├── documentation.yml │ ├── release.yml │ ├── reusable-testing.yml │ ├── tag-and-release.yml │ ├── testing-dispatch.yml │ └── testing.yml ├── .gitignore ├── .golangci.yml ├── .goreleaser.yml ├── .mockery_matryer.yml ├── .mockery_testify.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── Taskfile.yml ├── codecov.yml ├── config/ │ ├── README.md │ ├── config.go │ └── config_test.go ├── docs/ │ ├── configuration.md │ ├── dev-notes.md │ ├── faq.md │ ├── generate-directive.md │ ├── include-auto-generated.md │ ├── index.md │ ├── inpackage.md │ ├── installation.md │ ├── javascripts/ │ │ └── tablesort.js │ ├── replace-type.md │ ├── requirements.txt │ ├── stylesheets/ │ │ └── extra.css │ ├── template/ │ │ ├── index.md │ │ ├── matryer.md │ │ └── testify.md │ └── v3.md ├── e2e/ │ ├── run_all.sh │ ├── test_infinite_mocking.sh │ ├── test_missing_interface/ │ │ ├── .mockery.yml │ │ └── run.sh │ ├── test_mockery_generation.sh │ ├── test_remote_templates/ │ │ └── remote_templates_test.go │ ├── test_template_data_schema_validation/ │ │ ├── .mockery.yml │ │ ├── template.templ │ │ ├── template.templ.schema.json │ │ └── validation_test.go │ └── test_template_exercise/ │ ├── .mockery.yml │ ├── exercise.templ │ ├── exercise.templ.schema.json │ ├── exercise_expected.txt │ └── exercise_test.go ├── foo.go ├── foo_test.go ├── go.mod ├── go.sum ├── go.work ├── go.work.sum ├── internal/ │ ├── cmd/ │ │ ├── init.go │ │ ├── init_test.go │ │ ├── migrate.go │ │ ├── migrate_test.go │ │ ├── mockery.go │ │ ├── mocks_testify_cmd_test.go │ │ ├── showconfig.go │ │ └── version.go │ ├── config/ │ │ └── config.go │ ├── errors.go │ ├── file/ │ │ ├── exists.go │ │ ├── exists_test.go │ │ ├── find.go │ │ └── find_test.go │ ├── fixtures/ │ │ ├── 12345678/ │ │ │ └── http/ │ │ │ └── http.go │ │ ├── any_keyword.go │ │ ├── argument_is_func_type.go │ │ ├── argument_is_map_func.go │ │ ├── async.go │ │ ├── auto_generated_skip/ │ │ │ ├── auto_generated.go │ │ │ ├── foo.go │ │ │ ├── foo_test.go │ │ │ └── mocks_testify_autogeneratedskip_test.go │ │ ├── buildtag/ │ │ │ ├── comment/ │ │ │ │ ├── custom2_iface.go │ │ │ │ ├── custom_iface.go │ │ │ │ ├── darwin_iface.go │ │ │ │ ├── freebsd_iface.go │ │ │ │ ├── linux_iface.go │ │ │ │ ├── mocks_testify_comment_test.go │ │ │ │ └── windows_iface.go │ │ │ └── filename/ │ │ │ ├── iface_darwin.go │ │ │ ├── iface_freebsd.go │ │ │ ├── iface_linux.go │ │ │ └── iface_windows.go │ │ ├── constraint_ifaces/ │ │ │ ├── constraint_interfaces.go │ │ │ └── constraint_interfaces_test.go │ │ ├── constraints/ │ │ │ └── constraints.go │ │ ├── consul.go │ │ ├── custom_error.go │ │ ├── directive_comments/ │ │ │ ├── directive_comments.go │ │ │ ├── directive_comments_test.go │ │ │ ├── mocks_matryer_directive_comments_test.go │ │ │ ├── mocks_testify_directive_comments_test.go │ │ │ └── server_with_different_file.go │ │ ├── directive_comments_example/ │ │ │ └── interface.go │ │ ├── empty_interface.go │ │ ├── empty_return/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ ├── mocks_matryer_empty_return_test.go │ │ │ └── mocks_testify_empty_return_test.go │ │ ├── example_project/ │ │ │ ├── bar/ │ │ │ │ └── foo/ │ │ │ │ └── client.go │ │ │ ├── baz/ │ │ │ │ ├── foo.go │ │ │ │ └── internal/ │ │ │ │ └── foo/ │ │ │ │ └── foo.go │ │ │ ├── context/ │ │ │ │ └── context.go │ │ │ ├── foo/ │ │ │ │ ├── foo.go │ │ │ │ └── pkg_name_same_as_import.go │ │ │ ├── mocks_testify_example_project_test.go │ │ │ ├── pkg_with_submodules/ │ │ │ │ ├── go.mod │ │ │ │ ├── string.go │ │ │ │ ├── submodule/ │ │ │ │ │ ├── go.mod │ │ │ │ │ └── string.go │ │ │ │ └── subpkg/ │ │ │ │ ├── string.go │ │ │ │ └── submodule/ │ │ │ │ ├── go.mod │ │ │ │ └── string.go │ │ │ ├── pkg_with_subpkgs/ │ │ │ │ ├── foo.go │ │ │ │ ├── subpkg1/ │ │ │ │ │ └── foo.go │ │ │ │ └── subpkg2/ │ │ │ │ ├── foo.go │ │ │ │ └── subpkg3/ │ │ │ │ └── foo.go │ │ │ ├── replace_type/ │ │ │ │ ├── README.md │ │ │ │ ├── mocks_testify_replace_type_test.go │ │ │ │ ├── rt.go │ │ │ │ ├── rt_test.go │ │ │ │ └── rti/ │ │ │ │ ├── internal/ │ │ │ │ │ └── rti.go │ │ │ │ ├── rt1/ │ │ │ │ │ └── rt1.go │ │ │ │ └── rt2/ │ │ │ │ └── rt2.go │ │ │ ├── root.go │ │ │ ├── string.go │ │ │ └── string_test.go │ │ ├── expecter.go │ │ ├── expecter_test.go │ │ ├── func_args_collision.go │ │ ├── function.go │ │ ├── generic.go │ │ ├── http/ │ │ │ └── http.go │ │ ├── iface_new_type/ │ │ │ ├── iface_new_type_test.go │ │ │ ├── interface.go │ │ │ ├── mocks_testify_iface_new_type_test.go │ │ │ └── subpkg/ │ │ │ └── interface.go │ │ ├── iface_typed_param/ │ │ │ ├── getter_iface_typed_param.go │ │ │ ├── main_test.go │ │ │ └── mocks_testify_iface_typed_param_test.go │ │ ├── iface_typed_param_lowercase/ │ │ │ ├── getter_iface_typed_param.go │ │ │ ├── main_test.go │ │ │ └── mocks_testify_iface_typed_param_lowercase_test.go │ │ ├── imports_from_nested_interface.go │ │ ├── imports_same_as_package.go │ │ ├── include_auto_generated/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ └── mocks_testify_includeautogenerated_test.go │ │ ├── index_list_expr/ │ │ │ ├── index_list_expression.go │ │ │ ├── index_list_expression_test.go │ │ │ └── mocks_testify_index_list_expr_test.go │ │ ├── inpackage/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ └── subpkg/ │ │ │ └── mocks_testify_inpackage_test.go │ │ ├── instantiated_generic_interface.go │ │ ├── instantiated_generic_struct.go │ │ ├── interface_dir_relative/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ ├── internal/ │ │ │ │ └── fixtures/ │ │ │ │ └── interface_dir_relative/ │ │ │ │ └── mocks.go │ │ │ └── mocks/ │ │ │ └── fixtures/ │ │ │ └── interface_dir_relative/ │ │ │ └── mocks.go │ │ ├── io_import.go │ │ ├── issue_766.go │ │ ├── issue_766_test.go │ │ ├── map_to_interface.go │ │ ├── method_args/ │ │ │ └── same_name_arg_and_type/ │ │ │ ├── entity.go │ │ │ ├── entity_test.go │ │ │ └── mocks_testify_same_name_arg_and_type_test.go │ │ ├── mock_method_uses_pkg_iface.go │ │ ├── mocks_io_test.go │ │ ├── mocks_matryer_test_test.go │ │ ├── mocks_net_http_test.go │ │ ├── mocks_testify_test_test.go │ │ ├── multi_template/ │ │ │ ├── README.md │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ ├── mocks_matryer_multitemplate_test.go │ │ │ └── mocks_testify_multitemplate_test.go │ │ ├── nil_run.go │ │ ├── nil_run_test.go │ │ ├── output_dir/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ ├── mock/ │ │ │ │ └── mocks_matryer_output_dir_test.go │ │ │ ├── mocks_matryer_output_dir_test.go │ │ │ └── output_dir/ │ │ │ └── mocks_matryer_output_dir_test.go │ │ ├── panic_err.go │ │ ├── panic_err_test.go │ │ ├── pkg_with_no_files/ │ │ │ └── subpkg/ │ │ │ └── foo.go │ │ ├── recursive_generation/ │ │ │ ├── foo.go │ │ │ ├── mocks_testify_recursive_generation_test.go │ │ │ ├── subpkg1/ │ │ │ │ ├── foo.go │ │ │ │ └── mocks_testify_subpkg1_test.go │ │ │ ├── subpkg2/ │ │ │ │ ├── foo.go │ │ │ │ └── mocks_testify_subpkg2_test.go │ │ │ └── subpkg_with_only_autogenerated_files/ │ │ │ └── foo.go │ │ ├── recursive_generation_with_subpkg_exclude/ │ │ │ ├── foo.go │ │ │ ├── foo_test.go │ │ │ ├── mocks.go │ │ │ ├── subpkg1/ │ │ │ │ ├── foo.go │ │ │ │ └── mocks.go │ │ │ └── subpkg2/ │ │ │ └── foo.go │ │ ├── redefined_type_b/ │ │ │ └── redefined_type_b.go │ │ ├── replace_type_pointers/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ └── mocks_testify_replace_type_pointers_test.go │ │ ├── requester.go │ │ ├── requester2.go │ │ ├── requester3.go │ │ ├── requester4.go │ │ ├── requester_arg_same_as_import.go │ │ ├── requester_arg_same_as_named_import.go │ │ ├── requester_arg_same_as_pkg.go │ │ ├── requester_array.go │ │ ├── requester_elided.go │ │ ├── requester_iface.go │ │ ├── requester_ns.go │ │ ├── requester_ptr.go │ │ ├── requester_ret_elided.go │ │ ├── requester_slice.go │ │ ├── requester_test.go │ │ ├── requester_unexported.go │ │ ├── requester_variadic.go │ │ ├── same_name_imports.go │ │ ├── struct_value.go │ │ ├── struct_with_tag.go │ │ ├── template_exercise/ │ │ │ └── exercise.go │ │ ├── type_alias/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ ├── mocks_testify_type_alias_test.go │ │ │ └── subpkg/ │ │ │ └── interface.go │ │ ├── unexported/ │ │ │ ├── interface.go │ │ │ ├── interface_test.go │ │ │ └── mocks_testify_unexported_test.go │ │ ├── unsafe.go │ │ ├── variadic.go │ │ ├── variadic_return_func.go │ │ ├── variadic_return_func_test.go │ │ ├── variadic_with_multiple_returns.go │ │ ├── variadic_with_multiple_returns_test.go │ │ └── variadic_with_no_returns.go │ ├── interface.go │ ├── logging/ │ │ ├── logging.go │ │ └── logging_test.go │ ├── mock_matryer.templ │ ├── mock_matryer.templ.schema.json │ ├── mock_testify.templ │ ├── mock_testify.templ.schema.json │ ├── mockery_test.go │ ├── node_visitor.go │ ├── parse.go │ ├── remote_template.go │ ├── stackerr/ │ │ ├── stackerr.go │ │ └── stackerr_test.go │ ├── template_generator.go │ └── template_generator_test.go ├── main.go ├── mkdocs.yml ├── mockery-tools.env ├── mocks_testify_main_test.go ├── template/ │ ├── README.md │ ├── comment_group.go │ ├── comments.go │ ├── data.go │ ├── interface.go │ ├── interfaces.go │ ├── method.go │ ├── method_scope.go │ ├── package.go │ ├── packages.go │ ├── param.go │ ├── registry.go │ ├── template.go │ ├── template_data.go │ ├── template_test.go │ ├── type_param_data.go │ └── var.go ├── template_funcs/ │ ├── funcmap.go │ ├── funcmap_test.go │ ├── functions.go │ └── functions_test.go └── tools/ ├── cmd/ │ ├── root.go │ └── tag.go ├── go.mod ├── go.sum ├── main.go └── tools.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .boilerplate.txt ================================================ // TEST MOCKERY BOILERPLATE ================================================ FILE: .gitattributes ================================================ * text eol=lf *.png -text *.gif -text ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- ## Description A clear and concise description of what the bug is. ## Reproducer Steps to reproduce the behavior. ## Expected behavior A clear and concise description of what you expected to happen. ## Mockery version `vX.Y.Z` ## Installation Mechanism - [ ] `go get` - [ ] Pre-built release - [ ] homebrew - [ ] Other: [please describe] ## Go version Version of Go used to build mockery from source (if applicable). ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ Description ------------- Please include a summary of the changes and the related issue. Please also include relevant motivation and context. - Fixes # (issue) ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update Version of Go used when building/testing: --------------------------------------------- - [ ] 1.22 - [ ] 1.23 How Has This Been Tested? --------------------------- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration Checklist ----------- - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes ================================================ FILE: .github/workflows/documentation.yml ================================================ name: documentation on: push: branches: [ master, v3 ] permissions: contents: write jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: 3.x - uses: actions/cache@v4 with: key: v3-documentation-${{ runner.os }}-${{ steps.get-date.outputs.date }} path: .cache - run: sudo apt-get update && sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev - run: pip install -r docs/requirements.txt env: GH_TOKEN: ${{ secrets.GH_TOKEN }} - name: Setup doc deploy run: | git config --global user.name vektra-bot git config --global user.email vektra-bot@vektra.github.io git fetch origin gh-pages --depth=1 - name: Deploy docs run: "mike deploy --push --update-aliases $(grep VERSION mockery-tools.env | cut -d'=' -f 2 | cut -d'.' -f1-2) latest latest-v3" env: GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} ================================================ FILE: .github/workflows/release.yml ================================================ name: "release" on: workflow_dispatch: inputs: tag: description: "Tag to release" type: string required: true workflow_call: inputs: tag: description: "Tag to release" type: string required: true secrets: DOCKER_USERNAME: required: true DOCKER_PASSWORD: required: true GORELEASER_GITHUB_TOKEN: required: true GORELEASER_HOMEBREW_TAP_TOKEN: required: true permissions: contents: write jobs: release: runs-on: ubuntu-latest env: DOCKER_CLI_EXPERIMENTAL: "enabled" steps: - uses: actions/checkout@v4 with: fetch-depth: 0 ref: refs/tags/${{ inputs.tag }} - name: Set up Go uses: actions/setup-go@v4 with: go-version: 'stable' - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: GoReleaser uses: goreleaser/goreleaser-action@v2.7.0 with: args: release --clean version: "<2" env: GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} HOMEBREW_TAP_TOKEN: ${{ secrets.GORELEASER_HOMEBREW_TAP_TOKEN }} GORELEASER_CURRENT_TAG: ${{ inputs.tag }} ================================================ FILE: .github/workflows/reusable-testing.yml ================================================ name: Reusable Go Test on: workflow_call: inputs: ref: required: false type: string default: "" jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: os: ["macos-latest", "ubuntu-latest", "windows-latest"] go_vers: ["1.25", "1.26"] steps: - uses: actions/checkout@v2 with: fetch-depth: 0 ref: ${{ inputs.ref }} - name: Set up Go uses: actions/setup-go@v2 with: go-version: ${{ matrix.go_vers }} - name: Download dependencies run: go mod download -x - name: Test run: go run github.com/go-task/task/v3/cmd/task test.ci ================================================ FILE: .github/workflows/tag-and-release.yml ================================================ name: Test and maybe create a new release on: push: branches: [master, v3] permissions: contents: write jobs: test: uses: ./.github/workflows/reusable-testing.yml tag: runs-on: ubuntu-latest needs: test outputs: tag_result: ${{ steps.tag.outputs.tag_result }} requested_version: ${{ steps.tag.outputs.requested_version }} previous_version: ${{ steps.tag.outputs.previous_version }} steps: - run: sudo apt update && sudo apt install -y git && git --version - uses: actions/checkout@v2 with: # We need entire history of tags fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: ./tools/go.mod check-latest: true cache-dependency-path: "**/*.sum" - name: Install Task uses: arduino/setup-task@v2 with: version: 3.x repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Run tagging commands id: tag run: | set +e task -x tag 1>/tmp/versions.txt tag_result="$?" printf "versions: $(cat /tmp/versions.txt)\n" echo "requested_version=$(cut -d',' -f 1 /tmp/versions.txt)" >> $GITHUB_OUTPUT echo "previous_version=$(cut -d',' -f 2 /tmp/versions.txt)" >> $GITHUB_OUTPUT echo "tag_result=$tag_result" >> $GITHUB_OUTPUT # The range between 8 and 63 inclusive is reserved for custom # error codes that contain specific meaning. if [ $tag_result -lt 8 -o $tag_result -gt 63 ]; then exit $tag_result fi exit 0 - name: Push tags run: task tag.push if: steps.tag.outputs.tag_result == 0 release: needs: tag if: needs.tag.outputs.tag_result == 0 uses: ./.github/workflows/release.yml secrets: inherit with: tag: ${{ needs.tag.outputs.requested_version }} ================================================ FILE: .github/workflows/testing-dispatch.yml ================================================ name: Go Test (manual run) on: workflow_dispatch: inputs: ref: description: "Tag/commit to checkout." type: string required: true jobs: test: uses: ./.github/workflows/reusable-testing.yml with: ref: ${{ inputs.ref }} ================================================ FILE: .github/workflows/testing.yml ================================================ name: Go Test on: pull_request: branches: [ master, v3 ] jobs: test: uses: ./.github/workflows/reusable-testing.yml ================================================ FILE: .gitignore ================================================ mockery.prof dist .idea docs/ve ve .cache coverage.txt site/ .task/ tools/tools *.lua ================================================ FILE: .golangci.yml ================================================ linters: # Disable all linters. # Default: false disable-all: true # Enable specific linter # https://golangci-lint.run/usage/linters/#enabled-by-default enable: - errcheck - gofumpt - gosimple - govet - ineffassign - staticcheck - typecheck - contextcheck - durationcheck - copyloopvar - gocheckcompilerdirectives - gosec - loggercheck - nilerr - prealloc - predeclared - reassign - revive - testifylint linters-settings: revive: enable-all-rules: false rules: - name: 'var-naming' staticcheck: checks: - all - '-SA1024' testifylint: disable-all: true enable: - compares - empty - expected-actual - len gosimple: checks: - S1000 - S1001 - S1003 - S1004 - S1005 - S1006 - S1007 - S1008 - S1009 - S1010 - S1011 - S1012 - S1016 - S1017 - S1018 - S1019 - S1020 - S1021 - S1023 - S1024 - S1025 - S1028 - S1029 - S1030 - S1031 - S1032 - S1033 - S1034 - S1035 - S1036 - S1037 - S1038 - S1039 - S1040 issues: exclude-rules: - linters: - revive text: "var-naming: don't use an underscore in package name" ================================================ FILE: .goreleaser.yml ================================================ --- project_name: mockery before: hooks: - go mod download builds: - main: ./main.go binary: mockery ldflags: - -s -w -X github.com/vektra/mockery/v3/internal/logging.SemVer=v{{.Version}} env: - CGO_ENABLED=0 goos: - darwin - linux - windows goarch: - amd64 - arm64 archives: - name_template: >- {{ .ProjectName }}_{{ .Version }}_{{- title .Os }}_ {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }} files: - README.md - LICENSE checksum: name_template: "checksum.txt" snapshot: name_template: "{{ .Tag }}-next" changelog: sort: asc use: github-native dockers: - image_templates: ["vektra/mockery:{{ .Tag }}-amd64"] goarch: amd64 dockerfile: Dockerfile use: buildx build_flag_templates: - "--pull" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.name={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - "--platform=linux/amd64" - image_templates: ["vektra/mockery:{{ .Tag }}-arm64"] goarch: arm64 dockerfile: Dockerfile use: buildx build_flag_templates: - "--pull" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.name={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - "--platform=linux/arm64" docker_manifests: - name_template: vektra/mockery:{{ .Tag }} image_templates: - vektra/mockery:{{ .Tag }}-amd64 - vektra/mockery:{{ .Tag }}-arm64 - name_template: vektra/mockery:{{ .Major }} image_templates: - vektra/mockery:{{ .Tag }}-amd64 - vektra/mockery:{{ .Tag }}-arm64 - name_template: vektra/mockery:{{ .Major }}.{{ .Minor }} image_templates: - vektra/mockery:{{ .Tag }}-amd64 - vektra/mockery:{{ .Tag }}-arm64 - name_template: vektra/mockery:latest image_templates: - vektra/mockery:{{ .Tag }}-amd64 - vektra/mockery:{{ .Tag }}-arm64 release: prerelease: false make_latest: true git: ignore_tags: - v2 - v3 prerelease_suffix: "-" ================================================ FILE: .mockery_matryer.yml ================================================ template: matryer structname: "Moq{{.InterfaceName}}" filename: "mocks_matryer_{{.SrcPackageName}}_test.go" all: true template-data: skip-ensure: False stub-impl: True with-resets: True boilerplate-file: "./.boilerplate.txt" packages: github.com/vektra/mockery/v3/internal/fixtures: config: all: false include-interface-regex: '.*' exclude-interface-regex: 'RequesterGenerics' interfaces: Requester: configs: - structname: "Moq{{.InterfaceName}}SkipEnsure" template-data: skip-ensure: True - {} - structname: StubMatyer{{.InterfaceName}} template-data: stub-impl: True github.com/vektra/mockery/v3/internal/fixtures/empty_return: interfaces: EmptyReturn: configs: - structname: StubMatyer{{.InterfaceName}} template-data: stub-impl: True github.com/vektra/mockery/v3/internal/fixtures/output_dir: interfaces: OutputDirWithDifferentPkgName: config: dir: "{{.InterfaceDir}}/mock" pkgname: "mock" OutputDirWithSamePkgNameAsSrc: config: dir: "{{.InterfaceDir}}/output_dir" ================================================ FILE: .mockery_testify.yml ================================================ _anchors: foo: bar template: "testify" force-file-write: true formatter: "goimports" all: True dir: "{{.InterfaceDirRelative}}" structname: "{{.Mock}}{{.InterfaceName}}" pkgname: "{{.SrcPackageName}}" filename: "mocks_{{.Template}}_{{.SrcPackageName}}_test.go" template-data: boilerplate-file: "./.boilerplate.txt" packages: github.com/vektra/mockery/v3/internal/cmd: github.com/vektra/mockery/v3: config: dir: . github.com/vektra/mockery/v3/internal/fixtures/unexported: github.com/vektra/mockery/v3/internal/fixtures/buildtag/comment: github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type: config: recursive: True interfaces: RType: configs: - {} - structname: RTypeReplaced1 replace-type: github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt1: RType1: pkg-path: github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt2 type-name: RType2 github.com/vektra/mockery/v3/internal/fixtures: interfaces: VariadicWithNoReturns: config: template-data: unroll-variadic: true VariadicWithMultipleReturns: configs: - structname: MockVariadicWithMultipleReturnsUnrollVariadic template-data: unroll-variadic: true - structname: MockVariadicWithMultipleReturns template-data: unroll-variadic: false RequesterVariadic: configs: - structname: MockRequesterVariadicOneArgument template-data: unroll-variadic: False - structname: MockRequesterVariadic template-data: unroll-variadic: True Expecter: configs: - structname: MockExpecterAndRolledVariadic template-data: unroll-variadic: False - structname: MockExpecter template-data: unroll-variadic: True VariadicNoReturnInterface: config: template-data: unroll-variadic: False github.com/vektra/mockery/v3/internal/fixtures/recursive_generation: config: recursive: True github.com/vektra/mockery/v3/internal/fixtures/recursive_generation_with_subpkg_exclude: config: recursive: True filename: mocks.go exclude-subpkg-regex: - subpkg2 github.com/vektra/mockery/v3/internal/fixtures/empty_return: github.com/vektra/mockery/v3/internal/fixtures/method_args/same_name_arg_and_type: github.com/vektra/mockery/v3/internal/fixtures/iface_typed_param: github.com/vektra/mockery/v3/internal/fixtures/iface_typed_param_lowercase: github.com/vektra/mockery/v3/internal/fixtures/example_project: github.com/vektra/mockery/v3/internal/fixtures/index_list_expr: github.com/vektra/mockery/v3/internal/fixtures/iface_new_type: github.com/vektra/mockery/v3/internal/fixtures/auto_generated_skip: github.com/vektra/mockery/v3/internal/fixtures/type_alias: io: config: all: True dir: internal/fixtures/ pkgname: test filename: mocks_io_test.go net/http: config: all: false dir: internal/fixtures/ pkgname: test filename: mocks_net_http_test.go interfaces: ResponseWriter: github.com/vektra/mockery/v3/internal/fixtures/inpackage: config: dir: "{{.InterfaceDirRelative}}/subpkg" inpackage: true template-data: # Set a build tag that won't be picked up by tests. The generated # mock file is going to be invalid due to the inpackage: true # config. mock-build-tags: nobuild github.com/vektra/mockery/v3/internal/fixtures/include_auto_generated: config: include-auto-generated: true github.com/vektra/mockery/v3/internal/fixtures/multi_template: config: template: testify interfaces: Foo: configs: - structname: MockTestifyFoo template: testify - structname: MockMatryerFoo template: matryer github.com/vektra/mockery/v3/internal/fixtures/replace_type_pointers: interfaces: InterfaceWithPointers: config: replace-type: github.com/vektra/mockery/v3/internal/fixtures/replace_type_pointers: Foo: pkg-path: github.com/vektra/mockery/v3/internal/fixtures/replace_type_pointers type-name: Bar github.com/vektra/mockery/v3/internal/fixtures/directive_comments: config: all: False interfaces: MatryerRequester: config: structname: TheMatryerRequester InterfaceWithoutGenerate: ServerWithDifferentFile: configs: - structname: FunServerWithDifferentFile - structname: AnotherFunServerWithDifferentFile github.com/vektra/mockery/v3/internal/fixtures/constraint_ifaces: github.com/vektra/mockery/v3/internal/fixtures/interface_dir_relative: config: filename: mocks.go interfaces: Foo: configs: # This first option simply asserts that InterfaceDirRelative is an actual path. https://github.com/vektra/mockery/issues/1133 - dir: '{{.InterfaceDir}}/{{ replaceAll "internal/" "" (index (splitAfterN "/" 2 .InterfaceDirRelative) 0) }}/mocks/{{index (splitAfterN "/" 2 .InterfaceDirRelative) 1}}' # The second option asserts that the value itself is sane. https://github.com/vektra/mockery/issues/1133#issuecomment-3758283921 # This mock will be explicitly tested against so that we can assert in tests that the value # does not encounter breaking changes. - dir: '{{.InterfaceDir}}/{{.InterfaceDirRelative}}' ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at landonclipp@gmail.com. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing Thank you for investing your time in contributing to our project! Read our [Code of Conduct](https://github.com/vektra/mockery/blob/master/CODE_OF_CONDUCT.md) to keep our community approachable and respectable. ## Local development setup All of the local development tools are go-based and are versioned in our go.mod file. Simply call `go download -x` to initialize and download all of our tooling. This project uses Taskfile, a better alternative to Makefile. Run `task -l` for list of valid targets. ## Working with documentation We use [mkdocs](https://www.mkdocs.org/) with the [mkdocs-material theme](https://squidfunk.github.io/mkdocs-material/). To preview the documentation locally, run `task mkdocs.serve`. The task will install the required mkdocs plugins and theme and run the mkdocs server with real-time updating/refreshing. ## Submitting PRs Before submitting PRs, it's strongly recommended you create an issue to discuss the problem, and possible solutions. PRs added without any discussion run the risk of not being accepted, which is a waste of your time. Issues marked with `approved feature` are features that the maintainers are willing to accept into the code, and are approved for development. PRs that implement an `approved feature` have a high likelihood of being accepted. ================================================ FILE: Dockerfile ================================================ FROM golang:1.26-alpine as builder RUN apk --update add --no-cache gcc musl-dev git openssh COPY mockery /usr/local/bin # Explicitly set a writable cache path when running --user=$(id -u):$(id -g) # see: https://github.com/golang/go/issues/26280#issuecomment-445294378 ENV GOCACHE /tmp/.cache ENTRYPOINT ["/usr/local/bin/mockery"] ================================================ FILE: LICENSE ================================================ Copyright (c) 2014, Opinionated Architecture All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the {organization} nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: README.md ================================================ mockery ======= [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/vektra/mockery/v3/template) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/vektra/mockery) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/vektra/mockery) [![Go Report Card](https://goreportcard.com/badge/github.com/vektra/mockery/v3)](https://goreportcard.com/report/github.com/vektra/mockery/v3) [![codecov](https://codecov.io/gh/vektra/mockery/branch/master/graph/badge.svg)](https://codecov.io/gh/vektra/mockery) mockery provides the ability to easily generate mocks for Golang interfaces using the [stretchr/testify/mock](https://pkg.go.dev/github.com/stretchr/testify/mock?tab=doc) package. It removes the boilerplate coding required to use mocks. Documentation -------------- Documentation is found at our [GitHub Pages site](https://vektra.github.io/mockery/). Development ------------ taskfile.dev is used for build tasks. Initialize all go build tools: ``` go mod download -x ``` You can run any of the steps listed in `Taskfile.yml`: ``` $ task test task: [test] go test -v -coverprofile=coverage.txt ./... ``` Stargazers ---------- [![Stargazers over time](https://starchart.cc/vektra/mockery.svg)](https://starchart.cc/vektra/mockery) ================================================ FILE: Taskfile.yml ================================================ version: "3" tasks: coverage: deps: [test] desc: run unit tests and create HTML coverage file cmds: - go tool cover -html=coverage.txt fmt: desc: auto-format all go files sources: - "**/*.go" cmds: - gofumpt -l -w . mocks: desc: generate new mocks from scratch cmds: - task: mocks.remove - task: mocks.generate mocks.remove: desc: remove all mock files deps: - mocks.remove.windows - mocks.remove.unix mocks.remove.windows: desc: remove all mock files on windows platforms: ["windows"] cmds: - rm -f files.txt - where /r . '*_mock.go' > files.txt || true - where /r . 'mock_*_test.go' >> files.txt || true - where /r . 'mocks_moq.go' >> files.txt || true - where /r . 'mocks_test.go' >> files.txt || true - where /r . 'mocks_*_test.go' >> files.txt || true - where /r . 'mocks_matryer_*.go' >> files.txt || true - where /r . 'mocks.go' >> files.txt || true - powershell -Command 'foreach ($file in Get-Content "files.txt") { If (Test-Path $file) {Remove-Item $file} }' - rm -rf mocks/ - rm -f files.txt mocks.remove.unix: desc: remove all mock files on unix platforms: ["darwin", "linux"] cmds: - find . -name '*_mock.go' -o -name 'mock_*_test.go' -o -name "mocks_moq.go" -o -name 'mocks_test.go' -o -name 'mocks_*_test.go' -o -name 'mocks_matryer_*.go' -o -name 'mocks.go' | xargs -r rm - rm -rf mocks/ mocks.generate.custom: cmds: - go run . mocks.generate.testify: desc: Generate testify mocks cmds: - MOCKERY_CONFIG=./.mockery_testify.yml go run . mocks.generate.matryer: desc: Generate matryer mocks cmds: - MOCKERY_CONFIG=./.mockery_matryer.yml go run . mocks.generate: desc: generate mocks deps: - mocks.generate.testify - mocks.generate.matryer git-state: desc: Check for a dirty git git-state cmds: - git diff --exit-code docker: desc: build the mockery docker image cmds: - docker build -t vektra/mockery . mkdocs.install: desc: install mkdocs and plugins sources: - "docs/requirements.txt" cmds: - pip install -r docs/requirements.txt mkdocs.serve: desc: serve mkdocs locally deps: [mkdocs.install] cmds: - mkdocs serve lint: desc: run all the defined linters sources: - "**/*.go" cmds: - go run github.com/golangci/golangci-lint/cmd/golangci-lint run test: cmds: - go run gotest.tools/gotestsum --format testname -- -v -coverprofile=coverage.txt ./internal/... ./template_funcs/... ./template/... desc: run unit tests generates: - coverage.txt test.e2e: desc: run end-to-end tests cmds: - bash ./e2e/run_all.sh - go run gotest.tools/gotestsum --format testname -- -v -count=1 ./e2e/... test.ci: deps: [lint] cmds: - task: mocks - task: git-state - task: test - task: mocks.remove - task: test.e2e default: deps: [test.ci] build-tools: desc: Build tools directory cmds: - cd ./tools && go build -o tools . tag: desc: Tag the git repo with the version specified. deps: [build-tools] cmds: - ./tools/tools tag --dry-run=false tag.push: desc: Push tags to origin cmds: - git push origin --tags --force ================================================ FILE: codecov.yml ================================================ coverage: precision: 5 round: down range: "00...100" status: patch: default: target: 40% threshold: 35% base: auto ================================================ FILE: config/README.md ================================================ Config ------ The `config` package provides mockery configuration semantics and behaviors. The [`RootConfig`](https://pkg.go.dev/github.com/vektra/mockery/v3/config#RootConfig) type defines the schema for the top-level `.mockery.yml` file. ================================================ FILE: config/config.go ================================================ // Package config defines the schemas and functionality of the .mockery.yml // config files. This package is NOT meant to be used by external Go libraries. // We expose the contents of this package purely for documentation purposes. // // Do NOT import this package. We cannot guarantee backwards-compatibility of // the methods herein. package config import ( "bytes" "context" "fmt" "go/ast" "os" "path/filepath" "reflect" "regexp" "strconv" "strings" "text/template" "github.com/brunoga/deep" "github.com/go-viper/mapstructure/v2" koanfYAML "github.com/knadh/koanf/parsers/yaml" "github.com/knadh/koanf/providers/env" "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/posflag" "github.com/knadh/koanf/providers/structs" "github.com/knadh/koanf/v2" "github.com/rs/zerolog" "github.com/spf13/pflag" internalConfig "github.com/vektra/mockery/v3/internal/config" "github.com/vektra/mockery/v3/internal/logging" "github.com/vektra/mockery/v3/internal/stackerr" "github.com/vektra/mockery/v3/template_funcs" "golang.org/x/tools/go/packages" "golang.org/x/tools/imports" "gopkg.in/yaml.v3" ) // TemplateData is the data sent to the template for the config file. type TemplateData struct { // ConfigDir is the directory of where the mockery config file is located. ConfigDir string // InterfaceDir is the directory of the interface being mocked. InterfaceDir string // InterfaceDirRelative is the same as InterfaceDir, but made relative to mockery's current working directory. InterfaceDirRelative string // InterfaceFile is the filename of where the interface is defined. InterfaceFile string // InterfaceName is the name of the interface (duh). InterfaceName string // Mock is a parameter that takes the value of "Mock" if the interface is exported, and "mock" otherwise. Mock string // StructName is the configured name of the mock. StructName string // SrcPackageName is the name of the source package as defined by the `package [name]` in the source package. SrcPackageName string // SrcPackagePath is the fully qualified package path of the source package. e.g. "github.com/vektra/mockery/v3". SrcPackagePath string // Template is the value of the `template` parameter. Template string } func addr[T any](v T) *T { return &v } func deref[T any](t *T) T { if t == nil { return *new(T) } return *t } func NewDefaultKoanf(ctx context.Context) (*koanf.Koanf, error) { c := Config{ All: addr(false), Anchors: map[string]any{}, Dir: addr("{{.InterfaceDir}}"), FileName: addr("mocks_test.go"), ForceFileWrite: addr(true), Formatter: addr("goimports"), FormatterOptions: defaultFormatterOptions(), Generate: addr(true), IncludeAutoGenerated: addr(false), LogLevel: addr("info"), StructName: addr("{{.Mock}}{{.InterfaceName}}"), PkgName: addr("{{.SrcPackageName}}"), Recursive: addr(false), RequireTemplateSchemaExists: addr(true), Template: addr("testify"), TemplateData: map[string]any{}, TemplateSchema: addr("{{.Template}}.schema.json"), } k := koanf.New("|") if err := k.Load(structs.Provider(c, "koanf"), nil); err != nil { return nil, stackerr.NewStackErr(err) } return k, nil } func defaultFormatterOptions() *FormatterOptions { return &FormatterOptions{ // Matches goimports defaults: // https://cs.opensource.google/go/x/tools/+/refs/tags/v0.41.0:imports/forward.go;l=53 GoImports: &GoImports{ AllErrors: addr(false), Comments: addr(true), FormatOnly: addr(true), Fragment: addr(false), LocalPrefix: addr(""), TabIndent: addr(true), TabWidth: addr(8), }, } } type RootConfig struct { Config `koanf:",squash" yaml:",inline"` Packages map[string]*PackageConfig `koanf:"packages" yaml:"packages"` koanf *koanf.Koanf configFile string } func NewRootConfig( ctx context.Context, flags *pflag.FlagSet, ) (*RootConfig, *koanf.Koanf, error) { var configFile string log := zerolog.Ctx(ctx) var err error conf := &Config{} // Set all parameters to their respective zero-values. Need to use // reflection for this sadly. v := reflect.ValueOf(conf).Elem() for i := 0; i < v.NumField(); i++ { field := v.Field(i) if field.Kind() != reflect.Pointer { continue } if !field.IsNil() { continue } field.Set(reflect.New(field.Type().Elem())) } // There are some special cases where the default value of pointers // should be set to nil. conf.InPackage = nil k, err := NewDefaultKoanf(ctx) if err != nil { return nil, nil, err } var rootConfig RootConfig = RootConfig{ Config: *conf, koanf: k, } configFileFromEnv := os.Getenv("MOCKERY_CONFIG") if configFileFromEnv != "" { configFile = configFileFromEnv } if configFile == "" { configFileFromFlags, err := flags.GetString("config") if err != nil { return nil, nil, fmt.Errorf("getting --config from flags: %w", err) } if configFileFromFlags != "" { configFile = configFileFromFlags } } if configFile == "" { log.Debug().Msg("config file not specified, searching") configFile, err = internalConfig.FindConfig() if err != nil { return nil, k, fmt.Errorf("discovering mockery config: %w", err) } log.Debug().Str("config-file", configFile).Msg("config file found") } rootConfig.configFile = configFile koanfTags := conf.koanfTagNames() if err := k.Load( env.ProviderWithValue( "MOCKERY_", ".", func(key, value string) (string, any) { normalizedKey := strings.Replace(strings.ToLower(strings.TrimPrefix(key, "MOCKERY_")), "_", "-", -1) if _, exists := koanfTags[normalizedKey]; !exists { log.Debug().Str("env-var", key).Msg("environment variable unknown, not including in config map.") return "", nil } // Loading from environment variables is kind of weird. Koanf doesn't seem to // have a good way to automatically convert values destined for boolean fields // without resorting to reflection. We do something gross here by // just checking to see if the string "looks" like it should be // a boolean. The proper solution is to use reflection on the destination // struct to see what the type actually should be cast to. I'm sure // the koanf project would appreciate a PR to add an environment // parser: if strings.ToLower(value) == "true" || strings.ToLower(value) == "false" { valueAsBool, err := strconv.ParseBool(value) if err != nil { panic(err) } return normalizedKey, valueAsBool } return normalizedKey, value }), nil, ); err != nil { log.Err(err).Msg("failed to load environment provider") return nil, nil, stackerr.NewStackErr(err) } if err := k.Load(file.Provider(configFile), koanfYAML.Parser()); err != nil { return nil, k, fmt.Errorf("loading config file: %w", err) } if flags != nil { if err := k.Load(posflag.Provider(flags, ".", k), nil); err != nil { return nil, k, fmt.Errorf("loading flags: %w", err) } } // Second argument is nil because of a weird bug: https://github.com/knadh/koanf/issues/307 if err := k.UnmarshalWithConf("", &rootConfig, koanf.UnmarshalConf{ DecoderConfig: &mapstructure.DecoderConfig{ ErrorUnused: true, }, }); err != nil { return nil, k, fmt.Errorf("unmarshalling config: %w", err) } if err := rootConfig.Initialize(ctx); err != nil { return nil, k, fmt.Errorf("initializing root config: %w", err) } return &rootConfig, k, nil } func (c *RootConfig) ConfigFileUsed() string { return c.configFile } // mergreStringMaps merges two (possibly nested) maps. func mergeStringMaps(src, dest map[string]any) { for srcKey, srcValue := range src { if destValue, exists := dest[srcKey]; exists { // If the source value is a map, merge recursively if destMap, ok := destValue.(map[string]any); ok { if srcMap, ok := srcValue.(map[string]any); ok { mergeStringMaps(srcMap, destMap) continue } } continue } // Otherwise, set the value directly dest[srcKey] = srcValue } } // mergeConfigs merges the values from c1 into c2. func mergeConfigs(ctx context.Context, src Config, dest *Config) { log := zerolog.Ctx(ctx) // Merge root config with package config srcValue := reflect.ValueOf(src) destValue := reflect.ValueOf(dest) for i := 0; i < srcValue.NumField(); i++ { fieldLog := log.With(). Int("index", i). Str("name", srcValue.Type().Field(i).Name). Logger() fieldLog.Debug().Msg("Iterating over field for merging") srcFieldValue := srcValue.Field(i) destFieldValue := destValue.Elem().Field(i) if srcFieldValue.Kind() == reflect.Map { srcMap, ok := srcFieldValue.Interface().(map[string]any) if !ok { log.Debug().Msg("field value is not `any`, skipping merge") continue } destMap, ok := destFieldValue.Interface().(map[string]any) if !ok { log.Debug().Msg("dest map value is not `any`, skipping") continue } if destMap == nil { destFieldValue.Set(reflect.ValueOf(make(map[string]any))) } destMap = destFieldValue.Interface().(map[string]any) mergeStringMaps(srcMap, destMap) } else if srcFieldValue.Kind() == reflect.Pointer && srcFieldValue.IsNil() { // Do nothing, the src field is nil } else if srcFieldValue.Kind() == reflect.Pointer && destFieldValue.IsNil() { // Attribute is a pointer. We need to allocate a new value of the // same type as the type being pointed to. newValue := reflect.New(srcFieldValue.Elem().Type()) // Then, set this new value to the same value as the src. newValue.Elem().Set(srcFieldValue.Elem()) // newValue is already an address, so we can set destFieldValue // to it as-is. destFieldValue.Set(newValue) } else if destFieldValue.CanSet() && destFieldValue.IsZero() { destFieldValue.Set(srcFieldValue) } else { fieldLog.Debug(). Bool("can-set", destFieldValue.CanSet()). Bool("is-zero", destFieldValue.IsZero()). Msg("field not addressable, not merging.") } } } func (c *RootConfig) Initialize(ctx context.Context) error { log := zerolog.Ctx(ctx) recursivePackages := []string{} for pkgName, pkgConfig := range c.Packages { if pkgConfig == nil { pkgConfig = NewPackageConfig() c.Packages[pkgName] = pkgConfig } if pkgConfig.Config == nil { pkgConfig.Config = &Config{} } if pkgConfig.Interfaces == nil { pkgConfig.Interfaces = map[string]*InterfaceConfig{} } pkgLog := log.With().Str("package-path", pkgName).Logger() pkgCtx := pkgLog.WithContext(ctx) mergeConfigs(pkgCtx, c.Config, pkgConfig.Config) if err := pkgConfig.Initialize(pkgCtx); err != nil { return fmt.Errorf("initializing root config: %w", err) } if *pkgConfig.Config.Recursive { recursivePackages = append(recursivePackages, pkgName) } } for _, recursivePackageName := range recursivePackages { pkgLog := log.With().Str(logging.LogKeyPackagePath, recursivePackageName).Logger() pkgCtx := pkgLog.WithContext(ctx) pkgLog.Debug().Msg("package marked as recursive") subpkgs, err := c.subPackages(recursivePackageName) if err != nil { return fmt.Errorf("discovering sub packages of %s: %w", recursivePackageName, err) } parentPkgConfig := c.Packages[recursivePackageName] for _, subpkg := range subpkgs { recursivePkgConfig, err := c.GetPackageConfig(ctx, recursivePackageName) if err != nil { return fmt.Errorf("getting package config: %w", err) } if recursivePkgConfig.Config.ShouldExcludeSubpkg(subpkg) { pkgLog.Debug().Msg("package was marked for exclusion") continue } var subPkgConfig *PackageConfig if existingSubPkg, exists := c.Packages[subpkg]; exists { subPkgConfig = existingSubPkg } else { subPkgConfig = NewPackageConfig() } mergeConfigs(pkgCtx, *parentPkgConfig.Config, subPkgConfig.Config) c.Packages[subpkg] = subPkgConfig } } return nil } func (c *RootConfig) subPackages(pkgPath string) ([]string, error) { pkgs, err := packages.Load(&packages.Config{ Mode: packages.NeedName | packages.NeedFiles, }, pkgPath+"/...") if err != nil { return nil, fmt.Errorf("failed to load packages: %w", err) } convertPkgPath := func(pkgs []*packages.Package) []string { paths := make([]string, 0, len(pkgs)) for _, pkg := range pkgs { if len(pkg.GoFiles) == 0 { continue } paths = append(paths, pkg.PkgPath) } return paths } return convertPkgPath(pkgs), nil } func (c *RootConfig) GetPackageConfig(ctx context.Context, pkgPath string) (*PackageConfig, error) { pkgConfig, ok := c.Packages[pkgPath] if !ok { return nil, stackerr.NewStackErr(fmt.Errorf("package %s does not exist in the config", pkgPath)) } return pkgConfig, nil } // GetPackages returns a list of the packages that are defined in // the `packages` config section. func (c *RootConfig) GetPackages(ctx context.Context) ([]string, error) { packages := []string{} for key := range c.Packages { packages = append(packages, key) } return packages, nil } type PackageConfig struct { Config *Config `koanf:"config" yaml:"config,omitempty"` Interfaces map[string]*InterfaceConfig `koanf:"interfaces" yaml:"interfaces,omitempty"` } func NewPackageConfig() *PackageConfig { return &PackageConfig{ Config: &Config{}, Interfaces: map[string]*InterfaceConfig{}, } } func (c *PackageConfig) Initialize(ctx context.Context) error { for idx, ifaceConfig := range c.Interfaces { if ifaceConfig == nil { ifaceConfig = NewInterfaceConfig() c.Interfaces[idx] = ifaceConfig } if ifaceConfig.Config == nil { ifaceConfig.Config = &Config{} } mergeConfigs(ctx, *c.Config, ifaceConfig.Config) if err := ifaceConfig.Initialize(ctx); err != nil { return fmt.Errorf("initializing package config: %w", err) } } return nil } func (c PackageConfig) GetInterfaceConfig(ctx context.Context, interfaceName string, directiveConfig *Config) (*InterfaceConfig, error) { // If the interface has an explicit config, override it with the directive config. // This favor any config set in the directive comment over the original file based config. if ifaceConfig, ok := c.Interfaces[interfaceName]; ok { if directiveConfig != nil { newConfig, err := deep.Copy(directiveConfig) if err != nil { return nil, fmt.Errorf("cloning directive config: %w", err) } // Merge the interface config into the directive config clone. mergeConfigs(ctx, *ifaceConfig.Config, newConfig) ifaceConfig.Config = newConfig for i, subCfg := range ifaceConfig.Configs { newConfig, err := deep.Copy(directiveConfig) if err != nil { return nil, fmt.Errorf("cloning directive config: %w", err) } // Merge the interface config into the directive config clone. mergeConfigs(ctx, *subCfg, newConfig) ifaceConfig.Configs[i] = newConfig } } return ifaceConfig, nil } // We don't have a specific config for this interface, // we should create a new one. ifaceConfig := NewInterfaceConfig() // If there is a directive config, use it as the base config. if directiveConfig != nil { newConfig, err := deep.Copy(directiveConfig) if err != nil { return nil, fmt.Errorf("cloning directive config: %w", err) } ifaceConfig.Config = newConfig } // Finally, merge the package config into the new config mergeConfigs(ctx, *c.Config, ifaceConfig.Config) ifaceConfig.Configs = []*Config{ifaceConfig.Config} return ifaceConfig, nil } func (c PackageConfig) ShouldGenerateInterface( ctx context.Context, interfaceName string, ifaceConfig Config, hasDirectiveComment bool, ) (bool, error) { log := zerolog.Ctx(ctx) if hasDirectiveComment { if ifaceConfig.Generate != nil && !*ifaceConfig.Generate { log.Debug().Msg("interface has directive comment with generate: false, skipping generation") return false, nil } log.Debug().Msg("interface has directive comment, generating mock") return true, nil } if *c.Config.All { if *c.Config.IncludeInterfaceRegex != "" { log.Warn().Msg("interface config has both `all` and `include-interface-regex` set: `include-interface-regex` will be ignored") } if *c.Config.ExcludeInterfaceRegex != "" { log.Warn().Msg("interface config has both `all` and `exclude-interface-regex` set: `exclude-interface-regex` will be ignored") } log.Debug().Msg("`all: true` is set, interface should be generated") return true, nil } if _, exists := c.Interfaces[interfaceName]; exists { return true, nil } includeRegex := *c.Config.IncludeInterfaceRegex excludeRegex := *c.Config.ExcludeInterfaceRegex if includeRegex == "" { if excludeRegex != "" { log.Warn().Msg("interface config has `exclude-interface-regex` set but not `include-interface-regex`: `exclude-interface-regex` will be ignored") } return false, nil } includedByRegex, err := regexp.MatchString(includeRegex, interfaceName) if err != nil { return false, fmt.Errorf("evaluating `include-interface-regex`: %w", err) } if !includedByRegex { log.Debug().Msg("interface does not match include-interface-regex") return false, nil } log.Debug().Msg("interface matches include-interface-regex") if excludeRegex == "" { return true, nil } excludedByRegex, err := regexp.MatchString(excludeRegex, interfaceName) if err != nil { return false, fmt.Errorf("evaluating `exclude-interface-regex`: %w", err) } if excludedByRegex { log.Debug().Msg("interface matches exclude-interface-regex") return false, nil } log.Debug().Msg("interface does not match exclude-interface-regex") return true, nil } type InterfaceConfig struct { Config *Config `koanf:"config" yaml:"config,omitempty"` Configs []*Config `koanf:"configs" yaml:"configs,omitempty"` } func NewInterfaceConfig() *InterfaceConfig { return &InterfaceConfig{ Config: &Config{}, Configs: []*Config{}, } } func (c *InterfaceConfig) Initialize(ctx context.Context) error { if len(c.Configs) == 0 { c.Configs = []*Config{c.Config} } else { for _, subCfg := range c.Configs { mergeConfigs(ctx, *c.Config, subCfg) } } return nil } type ReplaceType struct { PkgPath string `koanf:"pkg-path" yaml:"pkg-path,omitempty"` TypeName string `koanf:"type-name" yaml:"type-name,omitempty"` } type GoImports struct { AllErrors *bool `koanf:"all-errors" yaml:"all-errors,omitempty"` Comments *bool `koanf:"comments" yaml:"comments,omitempty"` FormatOnly *bool `koanf:"format-only" yaml:"format-only,omitempty"` Fragment *bool `koanf:"fragment" yaml:"fragment,omitempty"` LocalPrefix *string `koanf:"local-prefix" yaml:"local-prefix,omitempty"` TabIndent *bool `koanf:"tab-indent" yaml:"tab-indent,omitempty"` TabWidth *int `koanf:"tab-width" yaml:"tab-width,omitempty"` } func (g *GoImports) GetLocalPrefix() string { return deref(g.LocalPrefix) } func (g *GoImports) Options() *imports.Options { return &imports.Options{ AllErrors: deref(g.AllErrors), Comments: deref(g.Comments), FormatOnly: deref(g.FormatOnly), Fragment: deref(g.Fragment), TabIndent: deref(g.TabIndent), TabWidth: deref(g.TabWidth), } } type FormatterOptions struct { GoImports *GoImports `koanf:"goimports" yaml:"goimports,omitempty"` } type Config struct { All *bool `koanf:"all" yaml:"all,omitempty"` Anchors map[string]any `koanf:"_anchors" yaml:"_anchors,omitempty"` BuildTags *string `koanf:"build-tags" yaml:"build-tags,omitempty"` ConfigFile *string `koanf:"config" yaml:"config,omitempty"` Dir *string `koanf:"dir" yaml:"dir,omitempty"` ExcludeSubpkgRegex []string `koanf:"exclude-subpkg-regex" yaml:"exclude-subpkg-regex,omitempty"` ExcludeInterfaceRegex *string `koanf:"exclude-interface-regex" yaml:"exclude-interface-regex,omitempty"` FileName *string `koanf:"filename" yaml:"filename,omitempty"` // ForceFileWrite controls whether mockery will overwrite existing files when generating mocks. This is by default set to false. ForceFileWrite *bool `koanf:"force-file-write" yaml:"force-file-write,omitempty"` Formatter *string `koanf:"formatter" yaml:"formatter,omitempty"` FormatterOptions *FormatterOptions `koanf:"formatter-options" yaml:"formatter-options,omitempty"` Generate *bool `koanf:"generate" yaml:"generate,omitempty"` IncludeAutoGenerated *bool `koanf:"include-auto-generated" yaml:"include-auto-generated,omitempty"` IncludeInterfaceRegex *string `koanf:"include-interface-regex" yaml:"include-interface-regex,omitempty"` InPackage *bool `koanf:"inpackage" yaml:"inpackage,omitempty"` LogLevel *string `koanf:"log-level" yaml:"log-level,omitempty"` StructName *string `koanf:"structname" yaml:"structname,omitempty"` PkgName *string `koanf:"pkgname" yaml:"pkgname,omitempty"` Recursive *bool `koanf:"recursive" yaml:"recursive,omitempty"` // ReplaceType is a nested map of format map["package path"]["type name"]*ReplaceType ReplaceType map[string]map[string]*ReplaceType `koanf:"replace-type" yaml:"replace-type,omitempty"` // RequireTemplateSchemaExists sets whether mockery will fail if the specified // template did not have an associated JSON schema. RequireTemplateSchemaExists *bool `koanf:"require-template-schema-exists" yaml:"require-template-schema-exists,omitempty"` Template *string `koanf:"template" yaml:"template,omitempty"` TemplateData map[string]any `koanf:"template-data" yaml:"template-data,omitempty"` // TemplateSchema is the URL of the template's JSON schema. TemplateSchema *string `koanf:"template-schema" yaml:"template-schema,omitempty"` } func (c Config) koanfTagNames() map[string]struct{} { tags := map[string]struct{}{} t := reflect.TypeOf(c) for i := 0; i < t.NumField(); i++ { field := t.Field(i) tag := field.Tag.Get("koanf") if tag != "" && tag != "-" { tags[tag] = struct{}{} } } return tags } func (c *Config) FilePath() string { return filepath.ToSlash(filepath.Clean(filepath.Join(*c.Dir, *c.FileName))) } func (c *Config) ShouldExcludeSubpkg(pkgPath string) bool { for _, regex := range c.ExcludeSubpkgRegex { matched, err := regexp.MatchString(regex, pkgPath) if err != nil { panic(err) } if matched { return true } } return false } var ErrInfiniteLoop = fmt.Errorf("infinite loop in template variables detected") // ParseTemplates parses various templated strings // in the config struct into their fully defined values. This mutates // the config object passed. An *Interface object can be supplied to satisfy // template variables that need information about the original // interface being mocked. If this argument is nil, interface-specific template // variables will be set to the empty string. The srcPkg is also needed to // satisfy template variables regarding the source package. func (c *Config) ParseTemplates( ctx context.Context, // ifaceFilePath is the absolute path of the original interface. ifaceFilePath string, ifaceName string, srcPkg *packages.Package, ) error { log := zerolog.Ctx(ctx) mock := "mock" if ast.IsExported(ifaceName) { mock = "Mock" } workingDir, err := os.Getwd() if err != nil { return fmt.Errorf("get working directory: %w", err) } workingDir = filepath.ToSlash(workingDir) ifaceFilePath = filepath.ToSlash(filepath.Clean(ifaceFilePath)) interfaceDirPath := filepath.ToSlash(filepath.Dir(ifaceFilePath)) interfaceDirRelativePath, err := filepath.Rel(filepath.FromSlash(workingDir), filepath.FromSlash(interfaceDirPath)) var interfaceDirRelative string if err != nil { log.Debug(). Err(err). Str("working-dir", workingDir). Str("interfaceDirPath", interfaceDirPath). Str("interface-dir-relative-path", interfaceDirRelativePath). Str("iface-file-path", ifaceFilePath). Msg("can't make path relative to working dir, setting to './'") interfaceDirRelative = "." } else { interfaceDirRelativePath = filepath.ToSlash(interfaceDirRelativePath) log.Debug(). Str("working-dir", workingDir). Str("interfaceDirPath", interfaceDirPath). Str("interface-dir-relative-path", interfaceDirRelativePath). Msg("found relative path") interfaceDirRelative = interfaceDirRelativePath } // data is the struct sent to the template parser data := TemplateData{ ConfigDir: filepath.Dir(*c.ConfigFile), InterfaceDir: interfaceDirPath, InterfaceDirRelative: interfaceDirRelative, InterfaceFile: ifaceFilePath, InterfaceName: ifaceName, Mock: mock, StructName: *c.StructName, SrcPackageName: srcPkg.Types.Name(), SrcPackagePath: srcPkg.Types.Path(), Template: *c.Template, } // These are the config options that we allow // to be parsed by the templater. The keys are // just labels we're using for logs/errors templateMap := map[string]*string{ "dir": c.Dir, "filename": c.FileName, "pkgname": c.PkgName, "structname": c.StructName, "template-schema": c.TemplateSchema, } changesMade := true for i := 0; changesMade; i++ { if i >= 20 { log.Error().Msg("infinite loop in template variables detected") for key, val := range templateMap { l := log.With().Str("variable-name", key).Str("variable-value", *val).Logger() l.Error().Msg("config variable value") } return ErrInfiniteLoop } // Templated variables can refer to other templated variables, // so we need to continue parsing the templates until it can't // be parsed anymore. changesMade = false for name, attributePointer := range templateMap { oldVal := *attributePointer attributeTempl, err := template.New("config-template").Funcs(template_funcs.FuncMap).Parse(*attributePointer) if err != nil { return fmt.Errorf("failed to parse %s template: %w", name, err) } var parsedBuffer bytes.Buffer log.Debug().Str("template-data", fmt.Sprintf("%+v", data)).Msg("executing template with data") if err := attributeTempl.Execute(&parsedBuffer, data); err != nil { return fmt.Errorf("failed to execute %s template: %w", name, err) } *attributePointer = parsedBuffer.String() if *attributePointer != oldVal { changesMade = true } } } return nil } func (c *Config) GetReplacement(pkgPath string, typeName string) *ReplaceType { pkgMap := c.ReplaceType[pkgPath] if pkgMap == nil { return nil } return pkgMap[typeName] } // ExtractDirectiveConfig parses interface's documentation from a declaration // node and extracts mockery's directive configuration. // // Mockery directives are comments that start with "mockery:" and can appear // multiple times in the interface's doc comments. All such comments are combined // and interpreted as YAML configuration. func ExtractDirectiveConfig(ctx context.Context, decl *ast.GenDecl) (*Config, error) { if decl == nil || decl.Doc == nil { return nil, nil } var yamlConfig []string // Extract all mockery directive comments and build a YAML document for _, doc := range decl.Doc.List { // Look for directive comments `//mockery:: ` and convert them to YAML if value, found := strings.CutPrefix(doc.Text, "//mockery:"); found && value != "" { yamlConfig = append(yamlConfig, value) } } if len(yamlConfig) == 0 { return nil, nil } // Combine all YAML lines into a single document yamlDoc := strings.Join(yamlConfig, "\n") // Parse the YAML directly into the directiveConfig struct directiveConfig := Config{} if err := yaml.Unmarshal([]byte(yamlDoc), &directiveConfig); err != nil { return nil, fmt.Errorf("unmarshaling directive yaml: %w", err) } return &directiveConfig, nil } ================================================ FILE: config/config_test.go ================================================ package config import ( "context" "errors" "fmt" "go/ast" "os" "path" "testing" "github.com/spf13/pflag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNewRootConfig(t *testing.T) { tests := []struct { name string config string wantErr error }{ { name: "unrecognized parameter", config: ` packages: github.com/foo/bar: config: unknown: param `, wantErr: fmt.Errorf("'packages[github.com/foo/bar].config' has invalid keys: unknown"), }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { configFile := path.Join(t.TempDir(), "config.yaml") require.NoError(t, os.WriteFile(configFile, []byte(tt.config), 0o600)) flags := pflag.NewFlagSet("test", pflag.ExitOnError) flags.String("config", "", "") require.NoError(t, flags.Parse([]string{"--config", configFile})) _, _, err := NewRootConfig(context.Background(), flags) if tt.wantErr == nil { assert.NoError(t, err) } else { var original error cursor := err for cursor != nil { original = cursor cursor = errors.Unwrap(cursor) } assert.Equal(t, tt.wantErr.Error(), original.Error()) } }) } } func TestNewRootConfigUnknownEnvVar(t *testing.T) { t.Setenv("MOCKERY_UNKNOWN", "foo") configFile := path.Join(t.TempDir(), "config.yaml") require.NoError(t, os.WriteFile(configFile, []byte(` packages: github.com/vektra/mockery/v3: `), 0o600)) flags := pflag.NewFlagSet("test", pflag.ExitOnError) flags.String("config", "", "") require.NoError(t, flags.Parse([]string{"--config", configFile})) _, _, err := NewRootConfig(context.Background(), flags) assert.NoError(t, err) } func TestNewRootConfigDefaultFormatterOptions(t *testing.T) { configFile := path.Join(t.TempDir(), "config.yaml") require.NoError(t, os.WriteFile(configFile, []byte(` formatter: goimports `), 0o600)) flags := pflag.NewFlagSet("test", pflag.ExitOnError) flags.String("config", "", "") require.NoError(t, flags.Parse([]string{"--config", configFile})) cfg, _, err := NewRootConfig(context.Background(), flags) require.NoError(t, err) require.NotNil(t, cfg.FormatterOptions.GoImports) assert.Equal(t, "goimports", *cfg.Formatter) assert.False(t, *cfg.FormatterOptions.GoImports.AllErrors) assert.True(t, *cfg.FormatterOptions.GoImports.Comments) assert.True(t, *cfg.FormatterOptions.GoImports.FormatOnly) assert.Equal(t, "", *cfg.FormatterOptions.GoImports.LocalPrefix) assert.True(t, *cfg.FormatterOptions.GoImports.TabIndent) assert.Equal(t, 8, *cfg.FormatterOptions.GoImports.TabWidth) } func TestExtractConfigFromDirectiveComments(t *testing.T) { configs := []struct { name string commentLines []string expected *Config expectError bool }{ { name: "no directive comments", commentLines: []string{ "// This is a regular comment.", "// Another regular comment.", }, expected: nil, expectError: false, }, { name: "regular comments are not directive comments", commentLines: []string{ "// Directive comments *must* shouldn't have spaces after the slashes.", "// mockery:structname: MyMock", }, expected: nil, expectError: false, }, { name: "valid single-line directive comment", commentLines: []string{ "//mockery:structname: MyMock", }, expected: &Config{ StructName: ptr("MyMock"), }, }, { name: "valid multi-line directive comments", commentLines: []string{ "// Some initial comment.", "//mockery:structname: MyMock", "//mockery:filename: my_mock.go", "// Some trailing comment.", }, expected: &Config{ StructName: ptr("MyMock"), FileName: ptr("my_mock.go"), }, expectError: false, }, { name: "invalid directive comment format", commentLines: []string{ "//mockery:structname MyMock", // Missing ':' }, expected: nil, expectError: true, }, { name: "unsupported configuration key are ignored", commentLines: []string{ "//mockery:unknown_key: value", }, expected: &Config{}, expectError: false, }, { name: "mixed valid and invalid directive comments", commentLines: []string{ "//mockery:structname: MyMock", "//mockery:invalid_format", // Invalid "//mockery:filename: my_mock.go", }, expected: nil, expectError: true, }, } for _, tt := range configs { t.Run(tt.name, func(t *testing.T) { comments := make([]*ast.Comment, len(tt.commentLines)) for i, line := range tt.commentLines { comments[i] = &ast.Comment{Text: line} } result, err := ExtractDirectiveConfig(context.Background(), &ast.GenDecl{ Doc: &ast.CommentGroup{ List: comments, }, }) if tt.expectError { require.Error(t, err) } else { require.NoError(t, err) assert.Equal(t, tt.expected, result) } }) } } func ptr[T any](s T) *T { return &s } ================================================ FILE: docs/configuration.md ================================================ Configuration ============== `mockery init` -------------- `mockery init [module_name]` is a useful command that can bootstrap you with a fully-functioning configuration set. For example, if we run: ``` title="" $ mockery init github.com/vektra/mockery/v3/internal/fixtures 2025-03-14T23:06:12.535709000-05:00 INF writing to file file=.mockery.yml version=v0.0.0-dev 2025-03-14T23:06:12.536493000-05:00 INF done version=v0.0.0-dev ```
```yaml title=".mockery.yml" all: false dir: '{{.InterfaceDir}}' filename: mocks_test.go force-file-write: false formatter: goimports log-level: info structname: '{{.Mock}}{{.InterfaceName}}' pkgname: '{{.SrcPackageName}}' recursive: false template: testify packages: github.com/vektra/mockery/v3/internal/fixtures: config: all: true ```
We can then run mockery against this config to generate the code: ``` title="" $ mockery 2025-03-14T23:42:17.014113000-05:00 INF Starting mockery config-file=/Users/landon/git/LandonTClipp/mockery/.mockery.yaml version=v0.0.0-dev 2025-03-14T23:42:17.014258000-05:00 INF Parsing configured packages... version=v0.0.0-dev 2025-03-14T23:42:17.527483000-05:00 INF Done parsing configured packages. version=v0.0.0-dev [...] 2025-03-14T23:42:17.531239000-05:00 INF Executing template file=/Users/landon/git/LandonTClipp/mockery/internal/fixtures/mocks_test.go version=v0.0.0-dev 2025-03-14T23:42:17.690601000-05:00 INF Writing template to file file=/Users/landon/git/LandonTClipp/mockery/internal/fixtures/mocks_test.go version=v0.0.0-dev ```
```title="" $ head -n 17 /Users/landon/git/LandonTClipp/mockery/internal/fixtures/mocks_test.go // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery package test import ( "encoding/json" "io" "net/http" "unsafe" mock "github.com/stretchr/testify/mock" http1 "github.com/vektra/mockery/v3/internal/fixtures/12345678/http" "github.com/vektra/mockery/v3/internal/fixtures/constraints" http0 "github.com/vektra/mockery/v3/internal/fixtures/http" test "github.com/vektra/mockery/v3/internal/fixtures/redefined_type_b" ) ```
??? tip "Extended Example" A more complex configuration example can be seen below: ```yaml all: False template-data: boilerplate-file: ./path/to/boilerplate.txt template: testify packages: github.com/vektra/example: config: # Make use of the template variables to place the mock in the same # directory as the original interface. dir: "{{.InterfaceDir}}" filename: "mocks_test.go" pkgname: "{{.PackageName}}_test" structname: "{{.Mock}}{{.InterfaceName}}" interfaces: Foo: Bar: config: # Make it unexported instead structname: "mock{{.InterfaceName}}" Baz: # Create two mock implementations of Baz with different names. configs: - filename: "mocks_baz_one_test.go" structname: "MockBazOne" - filename: "mocks_baz_two_test.go" structname: "MockBazTwo" io: config: dir: path/to/io/mocks filename: "mocks_io.go" ``` These are the highlights of the config scheme: 1. The parameters are merged hierarchically 2. There are a number of template variables available to generalize config values. 3. The style of mock to be generated is specified using the [`template`](template/index.md) parameter. Parameter Descriptions ----------------------- [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/vektra/mockery/v3/config#Config) | name | templated | default | description | |--------------------------------------------------------|---------------------------|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `all` | :fontawesome-solid-x: | `#!yaml false` | Generate all interfaces for the specified packages. | | `_anchors` | :fontawesome-solid-x: | `#!yaml {}` | Unused by mockery, but allowed in the config schema so that you may define arbitrary yaml anchors. | | `config` | :fontawesome-solid-x: | `#!yaml ""` | Set the location of the mockery config file. | | `dir` | :fontawesome-solid-check: | `#!yaml "{{.InterfaceDir}}"` | The directory where the mock file will be outputted to. | | `exclude-subpkg-regex` | :fontawesome-solid-x: | `#!yaml []` | A list of regular expressions that denote which subpackages should be excluded when `#!yaml recursive: true` | | `exclude-interface-regex` | :fontawesome-solid-x: | `#!yaml ""` | When set along with `include-interface-regex`, then interfaces which match `include-interface-regex` but also match `exclude-interface-regex` will not be generated. If `all` is set, or if `include-interface-regex` is not set, then `exclude-interface-regex` has no effect. | | `filename` | :fontawesome-solid-check: | `#!yaml "mocks_test.go"` | The name of the file the mock will reside in. Multiple interfaces from the same source package can be placed into the same output file. | | `force-file-write` | :fontawesome-solid-x: | `#!yaml true` | When set to `#!yaml force-file-write: true`, mockery will forcibly overwrite any existing files. Otherwise, it will fail if the output file already exists. | | `formatter` | :fontawesome-solid-x: | `#!yaml "goimports"` | The formatter to use on the rendered template. Choices are: `gofmt`, `goimports`, `noop`. | | `formatter-options` | :fontawesome-solid-x: | `#!yaml nil` | Additional options for the formatter. See below. | | `generate` | :fontawesome-solid-x: | `#!yaml true` | Can be used to selectively enable/disable generation of specific interfaces. See [the related docs](generate-directive.md) for more details. | | [`include-auto-generated`](include-auto-generated.md){ data-preview } | :fontawesome-solid-x: | `#!yaml false` | When set to `true`, mockery will parse files that are auto-generated. This can only be specified in the top-level config or package-level config. | | `include-interface-regex` | :fontawesome-solid-x: | `#!yaml ""` | When set, only interface names that match the expression will be generated. This setting is ignored if `all: True` is specified in the configuration. To further refine the interfaces generated, use `exclude-interface-regex`. | | [`inpackage`](inpackage.md){ data-preview } | :fontawesome-solid-x: | `#!yaml nil` | When set, this overrides mockery's auto-detection logic when determining if the mock file is inside or outside of the mocked interface's package. | | `log-level` | :fontawesome-solid-x: | `#!yaml "info"` | Set the level of the logger | | `structname` | :fontawesome-solid-check: | `#!yaml "{{.Mock}}{{.InterfaceName}}"` | The name of the generated interface implementation. | | `packages` | :fontawesome-solid-x: | `#!yaml null` | A dictionary containing configuration describing the packages and interfaces to generate mocks for. | | `pkgname` | :fontawesome-solid-check: | `#!yaml "{{.SrcPackageName}}"` | The `#!go package name` given to the generated mock files. | | `recursive` | :fontawesome-solid-x: | `#!yaml false` | When set to `true` on a particular package, mockery will recursively search for all sub-packages and inject those packages into the config map. | | [`replace-type`](replace-type.md){ data-preview } | :fontawesome-solid-x: | `#!yaml {}` | Use this parameter to specify type replacements. | | `build-tags` | :fontawesome-solid-x: | `#!yaml ""` | A space-separated list of additional build tags to load packages. | | `require-template-schema-exists` | :fontawesome-solid-x: | `#!yaml true` | If set to `#!yaml true` and the schema failed to download, mockery will fail. Otherwise, mockery will not attempt to download the file nor do any schema validation. | | `template` | :fontawesome-solid-x: | `#!yaml ""` | The template to use. The choices are defined in the [Templates](../template/) section. | | `template-data` | :fontawesome-solid-x: | `#!yaml {}` | A `map[string]any` that provides arbitrary options to the template. Each template will have a different set of accepted keys. Refer to each template's documentation for more details. | | `template-schema` | :fontawesome-solid-check: | `#!yaml "{{.Template}}.schema.json"` | The URL of the JSON schema to apply to the `template-data` parameter. See the [template docs](./template/index.md#schemas){ data-preview } for more details. | The `formatter-options` field allows formatter-specific configuration. Currently goimports is supported. For example: ```yaml title="mockery.yaml" --- formatter: goimports formatter-options: goimports: local-prefix: github.com/myrepo tab-indent: true ``` Templates --------- Parameters marked as being templated have access to a number of template variables and functions through the Go [`text/template`](https://pkg.go.dev/text/template#hdr-Examples) system. ### Variables The variables provided are specified in the [`config.TemplateData`](https://pkg.go.dev/github.com/vektra/mockery/v3/config#TemplateData) struct. ### Functions All of the functions defined in [`StringManipulationFuncs`](https://pkg.go.dev/github.com/vektra/mockery/v3/shared#pkg-variables) are available to templated parameters. Config sources -------------- Config can not only be specified from the `.yml` file, but also from CLI parameters (where available) and environment variables. For example, specifying a boolean value for a particular parameter called `enable-feature` from each config source would look like this: | source | value | |----------------------|------------------------------| | command line | `--enable-feature=true` | | Environment variable | `MOCKERY_ENABLE_FEATURE=True` | | yaml | `#!yaml enable-feature: True` | Config is loaded from each source in the following order: 1. Default values 2. Environment variables 3. Config file 4. CLI Parameters ================================================ FILE: docs/dev-notes.md ================================================ Developer Notes =============== Go Upgrades ------------ The mockery project supports the most recent TWO stable Go versions. Testing matrices will only run on the two most recent stable Go versions. However, given the [Go backwards-compatibility guarantee](https://go.dev/blog/compat), it's very likely projects built off of older Go 1.x syntax will continue to work in perpetuity.(1) { .annotate } 1. The caveat, being noted, is the same as the above linked backwards compatibility guarantee: > There are a few qualifications to that. First, compatibility means source compatibility. When you update to a new version of Go, you do have to recompile your code. Second, we can add new APIs, but not in a way that breaks existing code. > The end of the document warns, “[It] is impossible to guarantee that no future change will break any program.” Then it lays out a number of reasons why programs might still break. > For example, it makes sense that if your program depends on a buggy behavior and we fix the bug, your program will break. But we try very hard to break as little as possible and keep Go boring. There are two main approaches we’ve used so far: API checking and testing. Go Syntax Updates ------------------ When Go releases new syntax, there are two approaches that the mockery project will take: ### Mockery does not need to interact with the new syntax In such cases, the mockery project _only_ needs to upgrade its `golang.org/x/tools` dependency. This is necessary for the parsing step to simply not fail if it encounters new syntax. If mockery does not need to interact or understand this syntax, this dependency upgrade is likely all that's needed. Take for example the problems mentioned [here] when mockery upgraded to `go 1.24` in its `go.mod` file. In this situation, the project maintainers wanted to allow mockery to not crash when it parses syntax containing generic type alias syntax. However, the project did not _parse_ this syntax, so the only thing we needed to do was upgrade `golang.org/x/tools`. ### Mockery _does_ need to interact with the new syntax This situation was encountered in Go 1.18 when generics were introduced. [In this case](https://github.com/vektra/mockery/pull/456/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6), the project needed to be upgraded to `go 1.18` because mockery now had to directly parse and interpret generic types through the `go/ast` package. This was needed in conjunction with an upgrade of `golang.org/x/tools` that handles the actual parsing into `go/ast` data. It's possible in future versions of Go that only the `toolchain` directive needs to be upgraded to allow mockery to use a more recent `go/ast` package. The purposes of the `go` directive is supposed to inform the compiler what features of the Go language the module uses in its own syntax, so in this case as long as mockery does not itself use generics, it can parse generic type information from _other_ projects without needing to pin its `go` directive to the relevant version. ================================================ FILE: docs/faq.md ================================================ --- title: FAQ --- Frequently Asked Questions =========================== How do I generate mocks for external packages? ---------------------------- To generate mocks for external packages, you first need to `go get` the package in your project. Then, simply include the external package in your mockery config. For example: ```yaml packages: go.temporal.io/sdk: config: all: true recursive: true dir: mocks/{{.SrcPackagePath}} filename: mocks.go ``` error: `interface not found in source` -------------------------------------- !!! tip "v3.6.0" Version [`v3.6.0`](https://github.com/vektra/mockery/releases/tag/v3.6.0) of mockery fixed a bug in how files were detected to be auto-generated. Many users may find that mockery is suddenly unable to find mocks after upgrading to `v3.6.0`. Try providing: ```yaml title="" include-auto-generated: true ``` in your mockery config to see if this resolves the issue. This log message indicates that an interface was explicitly listed in the mockery config but it was not found in the source. This can happen for a number of reasons: 1. The package name was misspelled 2. The interface name was misspelled 3. The `#!yaml include-auto-generated: false` parameter was set (of which `false` is the default) and the interface lived in an auto-generated file. Setting `#!yaml log-level: debug` can provide a lot of insight into mockery's decision tree, so we recommend inspecting these logs for further clues into why the interface was not found. For more details on `include-auto-generated`, visit [the related documentation](include-auto-generated.md). error: `no go files found in root search path` --------------------------------------------- When using the `packages` feature, `recursive: true` and you have specified a package that contains no `*.go` files, mockery is unable to determine the on-disk location of the package in order to continue the recursive package search. This appears to be a limitation of the [golang.org/x/tools/go/packages](https://pkg.go.dev/golang.org/x/tools/go/packages) package that is used to parse package metadata. The solution is to create a `.go` file in the package's path and add a `package [name]` directive at the top. It doesn't matter what the file is called. This allows mockery to properly read package metadata. [Discussion](https://github.com/vektra/mockery/discussions/636) internal error: package without types was imported --------------------------------------------------- [https://github.com/vektra/mockery/issues/475](https://github.com/vektra/mockery/issues/475) This issue indicates that you have attempted to use package in your dependency tree (whether direct or indirect) that uses Go language semantics that your currently-running Go version does not support. The solution: 1. Update to the latest go version 2. Delete all cached packages with `go clean -modcache` 3. Reinstall mockery Additionally, this issue only happens when compiling mockery from source, such as with `go install`. Our docs [recommend not to use `go install`](../installation#go-install) as the success of your build depends on the compatibility of your Go version with the semantics in use. You would not encounter this issue if using one of the installation methods that install pre-built binaries, like downloading the `.tar.gz` binaries, or through `brew install`. Semantic Versioning ------------------- The mockery project follows the standard Semantic Versioning Semantics. The versioning applies to the following areas: 1. The shape of mocks generated by pre-curated templates. 2. Functions and data provided to templates specified with `#!yaml template: "file://"`. 3. Configuration options. Mockery is not meant to be used as an imported library. Importing mockery code in external modules is not supported. Mocking interfaces in `main` ---------------------------- When your interfaces are in the main package, you should supply the `--inpackage` flag. This will generate mocks in the same package as the target code, avoiding import issues. mockery fails to run when `MOCKERY_VERSION` environment variable is set ------------------------------------------------------------------------ This issue was first highlighted [in this GitHub issue](https://github.com/vektra/mockery/issues/391). mockery uses the viper package for configuration mapping and parsing. Viper is set to automatically search for all config variables specified in its config struct. One of the config variables is named `version`, which gets mapped to an environment variable called `MOCKERY_VERSION`. If you set this environment variable, mockery attempts to parse it into the `version` bool config. This is an adverse effect of how our config parsing is set up. The solution is to rename your environment variable to something other than `MOCKERY_VERSION`. ================================================ FILE: docs/generate-directive.md ================================================ # `//mockery:generate` :octicons-tag-24: v3.6.0 An alternative way to configure mocks is to use the `#!go //mockery:generate` directive. Mockery parses the doc comments and allows you to override configuration of specific interfaces in the source code. For example: ```yaml title=".mockery.yml" all: false packages: github.com/vektra/mockery/v3/internal/fixtures/directive_comments_example: ``` We set the top-level `#!yaml all: false` (which is the default value, anyway) to ensure that interfaces are by default not generated. We can then specify the doc comment directive to include the interface: ```go title="interface.go" package directivecommentsexample // Requester is an interface that defines a method for making HTTP requests. // //mockery:generate: true type Requester interface { Get(path string) (string, error) } ```
``` title="" 2025-11-11T14:40:22.897665000-05:00 INF adding interface to collection collection=/Users/landonclipp/git/LandonTClipp/mockery/internal/fixtures/directive_comments_example/mocks_test.go interface=Requester package-path=github.com/vektra/mockery/v3/internal/fixtures/directive_comments_example version=v0.0.0-dev ```
We can also specify any config value that mockery supports. For example, let's rename the mock's structname: ``` // Requester is an interface that defines a method for making HTTP requests. // //mockery:generate: true //mockery:structname: MockFoo type Requester interface { Get(path string) (string, error) } ``` The new `structname` is applied as expected: ```go // MockFoo is an autogenerated mock type for the Requester type type MockFoo struct { mock.Mock } ``` !!! note The `#!yaml generate:` parameter is only effectual from within the doc comment itself. It has no effect if specified within the mockery config file. ================================================ FILE: docs/include-auto-generated.md ================================================ # `#!yaml include-auto-generated:` :octicons-tag-24: v3.5.0 The `#!yaml include-auto-generated:` parameter specifies whether or not mockery should include source files that appear to be auto-generated. By default, mockery will search for the presence of a string in the source code that appears before the `#!go package foo` declaration that matches the regular expression `^\/\/ Code generated by .* DO NOT EDIT(\.?)( )*$`. Sometimes, users may wish to override this behavior and unconditionally include these source files. For example: ```yaml title=".mockery.yml" packages: github.com/vektra/mockery/v3/internal/fixtures/include_auto_generated: config: include-auto-generated: true ``` You may also set this at the top-level as such: ```yaml title=".mockery.yml" include-auto-generated: true packages: github.com/vektra/mockery/v3/internal/fixtures/include_auto_generated: ``` It is not possible to set this parameter at the interface level config because mockery performs this regular expression check before parsing the syntax in the source file. Allowing users to specify this on the interface-level config would require mockery to unconditionally parse all files, which defeats the performance benefits of excluding such auto-generated files in the first place. ================================================ FILE: docs/index.md ================================================ mockery ======== [v3 Migration Docs](v3.md){ .md-button .md-button--stretch } Mockery is a project that creates mock implementations of Golang interfaces. It inspects source code and generates implementations of the interface that aid in testing. In addition to providing a number of different styles of mocks, mockery also allows users to provide their own template files that will then be rendered using a set of template data, methods, and functions that provide comprehensive typing information about the Go interface in question. ![](assets/images/demo.gif) ![](assets/images/MockScreenshot.png) Why mockery? ------------- When you have an interface like this: ```golang title="db.go" type DB interface { Get(val string) string } ``` and a function that takes this interface: ```golang title="db_getter.go" func getFromDB(db DB) string { return db.Get("ice cream") } ``` We can use simple configuration to generate a mock implementation for the interface: ```yaml title=".mockery.yaml" packages: github.com/org/repo: interfaces: DB: ```
```bash $ mockery 05 Mar 23 21:49 CST INF Starting mockery dry-run=false version=v3.0.0 05 Mar 23 21:49 CST INF Using config: .mockery.yaml dry-run=false version=v3.0.0 05 Mar 23 21:49 CST INF Generating mock dry-run=false interface=DB qualified-name=github.com/org/repo version=v3.0.0 ```
We can then use the mock object in a test: ```go title="db_getter_test.go" import ( "testing" "github.com/stretchr/testify/assert" ) func Test_getFromDB(t *testing.T) { mockDB := NewMockDB(t) mockDB.EXPECT().Get("ice cream").Return("chocolate").Once() flavor := getFromDB(mockDB) assert.Equal(t, "chocolate", flavor) } ``` Why use mockery? ---------------- 1. You gain access to a number of pre-curated mock implementations that can be used in testing. This includes traditional "mockery-style" mocks, as well as other styles from the open source community such as from https://github.com/matryer/moq. Such mocks allow you to quickly define how the implementation should behave under test without having to manually curate your own mocks/stubs/fakes. 2. Mockery benefits from a large number of performance improvements that almost all other Go code-generation projects currently have not employed. This means that it's orders of magnitude faster for large codebases. 3. Mockery provides a comprehensive, centralized, flexible, and simple configuration scheme driven off of yaml instead of relying on sprawling `//go:generate` commands. 4. Mockery is a code-generation framework. While its original goal is to provide mock implementations for testing purposes, users can supply their own templates to auto-generate any kind of code that needs to be based off of interfaces. 5. A number of high profile companies, projects, and communities trust Mockery. Who uses mockery? ------------------
-
[![Kubernetes logo](assets/images/logos/kubernetes.svg){ class="center" width="100" }](https://github.com/kubernetes/kubernetes)
[Kubernetes](https://github.com/search?q=repo%3Akubernetes%2Fkubernetes%20mockery&type=code)
-
[![Grafana logo](assets/images/logos/grafana.svg){ class="center" width="100" }](https://github.com/grafana/grafana)
[Grafana](https://github.com/search?q=repo%3Agrafana%2Fgrafana%20mockery&type=code)
-
[![Google logo](assets/images/logos/google.svg){ class="center" width="100" }](https://github.com/google/skia)
[Google skia](https://github.com/google/skia)
-
[![Google logo](assets/images/logos/google.svg){ class="center" width="100" }](https://github.com/google/syzkaller)
[Google syzkaller](https://github.com/google/syzkaller)
-
[![Hashicorp logo](assets/images/logos/hashicorp.svg){ class="center" width="100" }](https://github.com/search?q=org%3Ahashicorp%20mockery&type=code)
[Hashicorp](https://github.com/search?q=org%3Ahashicorp%20mockery&type=code)
-
[![Jaeger logo](assets/images/logos/jaeger.png){ class="center" width="300" }](https://github.com/jaegertracing/jaeger)
[Jaegertracing](https://github.com/jaegertracing/jaeger)
-
[![Splunk logo](assets/images/logos/splunk.svg){ class="center" width="300" }](https://github.com/splunk/kafka-mq-go)
[Splunk kafka-mq-go](https://github.com/splunk/kafka-mq-go)
-
[![Ignite Logo](assets/images/logos/ignite-cli.png){ class="center" width="300" }](https://github.com/ignite/cli)
-
[![Tendermint Logo](assets/images/logos/tendermint.svg){ class="center" width="300" }](https://github.com/tendermint/tendermint)
-
[![Datadog logo](assets/images/logos/datadog.svg){ class="center" width="300" }](https://github.com/DataDog/datadog-agent)
- [![Seatgeek Logo](assets/images/logos/seatgeek.svg)](https://seatgeek.com) -
[![Amazon logo](assets/images/logos/amazon.svg){ class="center" width="300" }](https://github.com/eksctl-io/eksctl)
[eksctl](https://github.com/eksctl-io/eksctl)
-
[![MongoDB Logo](assets/images/logos/mongodb.svg){ class="center" width="300" }](https://github.com/search?q=org%3Amongodb%20mockery&type=code)
-
[![go-task logo](assets/images/logos/go-task.svg){ class="center" width="300" }](https://taskfile.dev/)
[Task](https://taskfile.dev/) -
[![cerbos logo](assets/images/logos/cerbos.png){ class="center" width="300" }](https://github.com/cerbos/cerbos)
[Get Started](installation.md){ .md-button .md-button--primary .md-button--stretch } ================================================ FILE: docs/inpackage.md ================================================ # `#!yaml inpackage:` :octicons-tag-24: v3.5.0 The `#!yaml inpackage` parameter overrides mockery's auto-detection logic that determines whether an output file resides inside or outside of the package of the original interface. Normally, import statements and type qualifiers (such as `srcpkg.TypeName`, the qualified variant of `TypeName`) are added when the mock references types in the original package _and_ the mock resides outside of that package. For example: ```go import ( mock "github.com/stretchr/testify/mock" "github.com/vektra/mockery/v3/internal/fixtures/inpackage" ) // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() inpackage.InternalStringType { ``` When `#!yaml inpackage: true` is set, the `"github.com/vektra/mockery/v3/internal/fixtures/inpackage"` import is removed and the type will be referred to as its unqualified name. For example: ```go import ( mock "github.com/stretchr/testify/mock" ) // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() InternalStringType { ``` ================================================ FILE: docs/installation.md ================================================ Getting Started ================ Installation ------------- ### GitHub Release recommended Visit the [releases page](https://github.com/vektra/mockery/releases) to download one of the pre-built binaries for your platform. ### go install Supported, but not recommended: [see wiki page](https://github.com/vektra/mockery/wiki/Installation-Methods#go-install) and [related discussions](https://github.com/vektra/mockery/pull/456).
!!! warning Do _not_ use `@latest` as this will pull from the latest, potentially untagged, commit on master. ### Docker Use the [Docker image](https://hub.docker.com/r/vektra/mockery) docker pull vektra/mockery Generate all the mocks for your project: docker run -v "$PWD":/src -w /src vektra/mockery:3 ### Homebrew Install through [brew](https://brew.sh/) brew install mockery brew upgrade mockery ================================================ FILE: docs/javascripts/tablesort.js ================================================ document$.subscribe(function() { var tables = document.querySelectorAll("article table:not([class])") tables.forEach(function(table) { new Tablesort(table) }) }) ================================================ FILE: docs/replace-type.md ================================================ # `#!yaml replace-type:` :octicons-tag-24: v3.0.0 The `#!yaml replace-type:` parameter allows you to replace a type in the generated mocks with another type. Take for example the following interface: ```go title="interface.go" package replace_type import ( "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt1" "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt2" ) type RType interface { Replace1(f rt1.RType1) } ``` You can selectively replace the `rt1.RType1` with a new type if so desired. For example: ### Schema ```yaml title=".mockery.yml" replace-type: github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt1: RType1: pkg-path: github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt2 type-name: RType2 ``` ### Result The mock will now replace all instances of `rt1.RType1` with `rt2.RType2`. You can see the before and after of `mockery`-style mocks: === "before" ```go // Replace2 provides a mock function for the type RTypeReplaced1 func (_mock *RTypeReplaced1) Replace1(f rt1.RType1) { _mock.Called(f) return } ``` === "after" ```go // Replace2 provides a mock function for the type RTypeReplaced1 func (_mock *RTypeReplaced1) Replace1(f rt2.RType2) { _mock.Called(f) return } ``` ## Background This parameter is useful if you need to need to work around packages that use internal types. Take for example the situation found [here](https://github.com/vektra/mockery/issues/864#issuecomment-2567788637), noted by [RangelReale](https://github.com/RangelReale). ================================================ FILE: docs/requirements.txt ================================================ mike @ git+https://github.com/jimporter/mike.git mkdocs mkdocs-glightbox mkdocs-material==9.7.1 mkdocs-open-in-new-tab cairosvg pillow mkdocs-table-reader-plugin ================================================ FILE: docs/stylesheets/extra.css ================================================ .md-button--stretch { width: 100%; text-align: center; } .center { display: block; margin-left: auto; margin-right: auto; margin-bottom: auto; } .md-grid { max-width: 200em; } ================================================ FILE: docs/template/index.md ================================================ Templates ========= Mockery, in its essence, renders templates. This project provides a number of pre-curated templates that you can select with the `#!yaml template:` config parameter. Each template will render a specific kind of implementation of the interface in question. Historically, mocks (used in testing) are common to generate, but anything that implements the interface is fair game. Mockery provides a few embedded templates you can render, or you can use a URL to specify a remotely-hosted template. ## Template Options ### [`#!yaml template: "testify"`](testify.md#description) [`testify`](testify.md#description){ data-preview } templates generate powerful, testify-based mock objects. They allow you to create expectations using argument-to-return-value matching logic. ### [`#!yaml template: "matryer"`](matryer.md#description) [`matryer`](matryer.md#description){ data-preview } templates draw from the mocks generated from the project at https://github.com/matryer/moq. This project was folded into mockery, and thus moq-style mocks can be natively generated from within mockery. Mocks generated using this template allow you to define precise functions to be run. ### `#!yaml template: "file://"` You may also provide mockery a path to your own file using the `file://` protocol specifier. The string after `file://` will be the relative or absolute path of your template. The templates are rendered with the data as shown in the [section below](#template-data). You can see examples of how the mockery project utilizes the template system to generate the different mock styles: - [`matryer.templ`](https://github.com/vektra/mockery/blob/v3/internal/mock_matryer.templ) - [`testify.templ`](https://github.com/vektra/mockery/blob/v3/internal/mock_testify.templ) ### `#!yaml template: "https://"` You can also host templates remotely. This allows you to specify something like: ```yaml title="" template: https://raw.githubusercontent.com/vektra/mockery/refs/tags/v3.0.0-beta.8/e2e/test_template_exercise/exercise.templ template-schema: https://raw.githubusercontent.com/vektra/mockery/refs/tags/v3.0.0-beta.8/e2e/test_template_exercise/exercise.templ.schema.json ``` !!! note "Note on Versioning" Templates hosted remotely should be versioned just like any other piece of code. We recommend hosting the template on a git repo so that you may reference explicit tags. It's best practice to maintain 3 sets of tags: 1. Major: `v3` 2. Minor: `v3.1` 3. Patch: `v3.1.2` This will give consumers of your template the ability to specify which level of granularity they want to track versions. The non-TLS variant is also supported: `#!yaml template: "http://"`, but not recommended for obvious reasons. ## Schemas Templates can provide a JSON Schema file that describes the format of the `TemplateData` parameter. Mockery auto-discovers the location of these schema files by appending `.schema.json` to the path of the template. For example, if you provide to mockery `#!yaml template: file://./path/to/template.tmpl`, it will look for a file at `file://./path/to/template.tmpl.schema.json`. If found, this schema will be applied to the `TemplateData` type sent to the template. To get started with JSON Schema, you can borrow an example JSON document used for the mockery project itself: ```json title="schema.json" { "$schema": "http://json-schema.org/draft-07/schema#", "title": "vektra/mockery testify mock", "type": "object", "additionalProperties": false, "properties": { "boilerplate-file": { "type": "string" }, "mock-build-tags": { "type": "string" }, "unroll-variadic": { "type": "boolean" } }, "required": [] } ``` Note that the `#!json "additionalProperties": false` parameter is crucial to ensure only the specified parameters exist in the configured `#!yaml template-data: {}` map. !!! tip "`template-schema`" You can specify a custom schema path using the [`#!yaml template-schema:`](../configuration.md#parameter-descriptions)parameter. ## Template Data Templates are rendered with functions and data you can utilize to generate your mocks. Links are shown below: | Description | Link | |-|-| | Functions | [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/vektra/mockery/v3/template_funcs#pkg-variables) | | Data | [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/vektra/mockery/v3/template#Data) | ================================================ FILE: docs/template/matryer.md ================================================ --- title: matryer --- `matryer` mocks are derived from the project at https://github.com/matryer/moq. These mocks create a struct that has a function field for each method, which you can declare in your test code. ## Description === "Interface" ```go package test type Requester interface { Get(path string) (string, error) } ``` === "Example Usage" ```go func TestRequesterMoq(t *testing.T) { m := &MoqRequester{ GetFunc: func(path string) (string, error) { fmt.Printf("Go path: %s\n", path) return path + "/foo", nil }, } result, err := m.Get("/path") assert.NoError(t, err) assert.Equal(t, "/path/foo", result) } ``` === "`.mockery.yml`" ```yaml template: matryer packages: github.com/vektra/mockery/v3/pkg/fixtures: config: dir: "{{.InterfaceDir}}" filename: "mocks_moq.go" pkgname: "test" structname: "Moq{{.InterfaceName}}" interfaces: Requester: ``` === "`mocks_matryer.go`" ```go // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery package test import ( "sync" ) // Ensure, that MoqRequester does implement Requester. // If this is not the case, regenerate this file with moq. var _ Requester = &MoqRequester{} // MoqRequester is a mock implementation of Requester. // // func TestSomethingThatUsesRequester(t *testing.T) { // // // make and configure a mocked Requester // mockedRequester := &MoqRequester{ // GetFunc: func(path string) (string, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequester in code that requires Requester // // and then make assertions. // // } type MoqRequester struct { // GetFunc mocks the Get method. GetFunc func(path string) (string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequester) Get(path string) (string, error) { // ... } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequester.GetCalls()) func (mock *MoqRequester) GetCalls() []struct { Path string } { // ... } ``` matryer-style mocks are far simpler, and probably more intuitive, than testify-style mocks. All that's needed is to define the function that will be run when the mock's method is called. ## `template-data` `moq` accepts the following `#!yaml template-data:` keys: | key | type | description | |-----|------|-------------| | `boilerplate-file` | `#!yaml string` | Specify a path to a file that contains comments you want displayed at the top of all generated mock files. This is commonly used to display license headers at the top of your source code. | | `mock-build-tags` | `#!yaml string` | Set the build tags of the generated mocks. Read more about the [format](https://pkg.go.dev/cmd/go#hdr-Build_constraints). | | `skip-ensure` | `#!yaml bool` | Suppress mock implementation check, avoid import cycle if mocks generated outside of the tested package. | | `stub-impl` | `#!yaml bool` | Return zero values when no mock implementation is provided, do not panic. | | `with-resets` | `#!yaml bool` | Generates methods that allow resetting calls made to the mocks. | ### Schema ```json --8<-- "internal/mock_matryer.templ.schema.json" ``` ================================================ FILE: docs/template/testify.md ================================================ --- title: testify --- Features for `#!yaml template: testify`. Choosing this template will render a traditional "mockery-style" template. The section below shows what will be rendered for the given interface. ## Description === "Interface" ```go package test type Requester interface { Get(path string) (string, error) } ``` === "Example Usage" ```go package test import ( "testing" "github.com/stretchr/testify/assert" ) func TestRequesterMock(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get("foo").Return("bar", nil).Once() retString, err := m.Get("foo") assert.NoError(t, err) assert.Equal(t, retString, "bar") } ``` === "`.mockery.yml`" ```yaml template: testify packages: github.com/vektra/mockery/v3/pkg/fixtures: config: dir: "{{.InterfaceDir}}" filename: "mocks.go" pkgname: "test" structname: "Mock{{.InterfaceName}}" interfaces: Requester: ``` === "`mocks.go`" ```go // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery package test import ( mock "github.com/stretchr/testify/mock" ) // NewRequester creates a new instance of Requester. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRequester (t interface { mock.TestingT Cleanup(func()) }) *Requester { // ... } // Requester is an autogenerated mock type for the Requester type type Requester struct { mock.Mock } type Requester_Expecter struct { mock *mock.Mock } func (_m *Requester) EXPECT() *Requester_Expecter { // ... } // Get provides a mock function for the type Requester func (_mock *Requester) Get(path string) (string, error) { // ... } // Requester_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type Requester_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path func (_e *Requester_Expecter) Get(path interface{}, ) *Requester_Get_Call { // ... } func (_c *Requester_Get_Call) Run(run func(path string)) *Requester_Get_Call { // ... } func (_c *Requester_Get_Call) Return(s string, err error) *Requester_Get_Call { // ... } func (_c *Requester_Get_Call) RunAndReturn(run func(path string)(string, error)) *Requester_Get_Call { // ... } ``` As you can see, this mock utilizes `github.com/stretchr/testify` under the hood and registers call expectations with testify. When the mock receives a call to `Get()`, it retrieves the expected value from testify to be returned. This style of mock also has other interesting methods: === "`#!go Run()`" Run a side effect when the argument matches. ```go func TestRequesterMockRun(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get(mock.Anything).Return("", nil) m.EXPECT().Get(mock.Anything).Run(func(path string) { fmt.Printf("Side effect! Argument is: %s", path) }) retString, err := m.Get("hello") assert.NoError(t, err) assert.Equal(t, retString, "") } ``` === "`#!go RunAndReturn()`" Run a function to perform side-effects, and return the result of the function. ```go func TestRequesterMockRunAndReturn(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get(mock.Anything).RunAndReturn(func(path string) (string, error) { return path + " world", nil }) retString, err := m.Get("hello") assert.NoError(t, err) assert.Equal(t, retString, "hello world") } ``` === "`github.com/stretchr/testify/mock.Mock`" Because the mock embeds the testify `Mock` object, you can all any methods on that as well. ```go func TestRequesterMockTestifyEmbed(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get(mock.Anything).Return("", nil).Twice() m.Get("hello") m.Get("world") assert.Equal(t, len(m.Mock.Calls), 2) } ``` ## `template-data` | key | type | description | |-----|------|-------------| | `boilerplate-file` | `#!yaml string` | Specify a path to a file that contains comments you want displayed at the top of all generated mock files. This is commonly used to display license headers at the top of your source code. | | `mock-build-tags` | `#!yaml string` | Set the build tags of the generated mocks. Read more about the [format](https://pkg.go.dev/cmd/go#hdr-Build_constraints). | | `unroll-variadic` | `#!yaml bool` | If set to `#!yaml unroll-variadic: true`, will expand the variadic argument to testify using the `...` syntax. See [notes](#variadic-arguments) for more details. | ### Schema ```json --8<-- "internal/mock_testify.templ.schema.json" ``` ## Features ### Mock Constructors :octicons-tag-24: v2.11.0 All mock objects have constructor functions. These constructors do basic test setup so that the expectations you set in the code are asserted before the test exits. Previously something like this would need to be done: ```go factory := &mocks.Factory{} factory.Test(t) // so that mock does not panic when a method is unexpected defer factory.AssertExpectations(t) ``` Instead, you may simply use the constructor: ```go factory := mocks.NewFactory(t) ``` The constructor sets up common functionalities automatically - The `AssertExpectations` method is registered to be called at the end of the tests via `t.Cleanup()` method. - The testing.TB interface is registered on the `mock.Mock` so that tests don't panic when a call on the mock is unexpected. ### Expecter Structs :octicons-tag-24: v2.10.0 · `with-expecter: True` Mockery now supports an "expecter" struct, which allows your tests to use type-safe methods to generate call expectations. When enabled through the `with-expecter: True` mockery configuration, you can enter into the expecter interface by simply calling `.EXPECT()` on your mock object. For example, given an interface such as ```go type Requester interface { Get(path string) (string, error) } ``` You can use the expecter interface as such: ```go requesterMock := mocks.NewRequester(t) requesterMock.EXPECT().Get("some path").Return("result", nil) ``` A `RunAndReturn` method is also available on the expecter struct that allows you to dynamically set a return value based on the input to the mock's call. ```go requesterMock.EXPECT(). Get(mock.Anything). RunAndReturn(func(path string) (string, error) { fmt.Println(path, "was called") return ("result for " + path), nil }) ``` !!! note Note that the types of the arguments on the `EXPECT` methods are `interface{}`, not the actual type of your interface. The reason for this is that you may want to pass `mock.Any` as an argument, which means that the argument you pass may be an arbitrary type. The types are still provided in the expecter method docstrings. ### Return Value Providers :octicons-tag-24: v2.20.0 Return Value Providers can be used one of two ways. You may either define a single function with the exact same signature (number and type of input and return parameters) and pass that as a single value to `Return`, or you may pass multiple values to `Return` (one for each return parameter of the mocked function.) If you are using the second form, for each of the return values of the mocked function, `Return` needs a function which takes the same arguments as the mocked function, and returns one of the return values. For example, if the return argument signature of `passthrough` in the above example was instead `(string, error)` in the interface, `Return` would also need a second function argument to define the error value: ```go type Proxy interface { passthrough(ctx context.Context, s string) (string, error) } ``` First form: ```go proxyMock := mocks.NewProxy(t) proxyMock.On("passthrough", mock.AnythingOfType("context.Context"), mock.AnythingOfType("string")). Return( func(ctx context.Context, s string) (string, error) { return s, nil } ) ``` Second form: ```go proxyMock := mocks.NewProxy(t) proxyMock.On("passthrough", mock.AnythingOfType("context.Context"), mock.AnythingOfType("string")). Return( func(ctx context.Context, s string) string { return s }, func(ctx context.Context, s string) error { return nil }, ) ``` ## Notes ### Variadic Arguments Consider if we have a function `#!go func Bar(message ...string) error`. A typical assertion might look like this: ```go func TestFoo(t *testing.T) { m := NewMockFoo(t) m.On("Bar", "hello", "world").Return(nil) ``` We might also want to make an assertion that says "any number of variadic arguments": ```go m.On("Bar", mock.Anything).Return(nil) ``` However, what we've given to mockery is ambiguous because it is impossible to distinguish between these two intentions: 1. Any number of variadic arguments of any value 2. A single variadic argument of any value This is fixed in [#359](https://github.com/vektra/mockery/pull/359) where you can provide `unroll-variadic: False` to get back to the old behavior. Thus, if you want to assert (1), you can then do: ```go m.On("Bar", mock.Anything).Return(nil) ``` If you want to assert (2), you must set `unroll-variadic: True`. Then this assertion's intention will be modified to mean the second case: ```go m.On("Bar", mock.Anything).Return(nil) ``` An upstream patch to `testify` is currently underway to allow passing `mock.Anything` directly to the variadic slice: [https://github.com/stretchr/testify/pull/1348](https://github.com/stretchr/testify/pull/1348) If this is merged, it would become possible to describe the above two cases respectively: ```go // case 1 m.On("Bar", mock.Anything).Return(nil) // case 2 m.On("Bar", []interface{}{mock.Anything}).Return(nil) ``` References: - [https://github.com/vektra/mockery/pull/359](https://github.com/vektra/mockery/pull/359) - [https://github.com/vektra/mockery/pull/123](https://github.com/vektra/mockery/pull/123) - [https://github.com/vektra/mockery/pull/550](https://github.com/vektra/mockery/pull/550) - [https://github.com/vektra/mockery/issues/541](https://github.com/vektra/mockery/issues/541) ### Multiple Expectations With Identical Arguments There might be instances where you want a mock to return different values on successive calls that provide the same arguments. For example, we might want to test this behavior: ```go // Return "foo" on the first call getter := NewGetter() assert(t, "foo", getter.Get("key")) // Return "bar" on the second call assert(t, "bar", getter.Get("key")) ``` This can be done by using the `.Once()` method on the mock call expectation: ```go mockGetter := NewMockGetter(t) mockGetter.EXPECT().Get(mock.anything).Return("foo").Once() mockGetter.EXPECT().Get(mock.anything).Return("bar").Once() ``` Or you can identify an arbitrary number of times each value should be returned: ```go mockGetter := NewMockGetter(t) mockGetter.EXPECT().Get(mock.anything).Return("foo").Times(4) mockGetter.EXPECT().Get(mock.anything).Return("bar").Times(2) ``` Note that with proper Go support in your IDE, all the available methods are self-documented in autocompletion help contexts. ================================================ FILE: docs/v3.md ================================================ v3 Migration ========== Mockery releases version 3 of the project that provides a number of high-profile benefits over v2: 1. Generation of [`matryer`](template/matryer.md)-style templates. The https://github.com/matryer/moq project is being subsumed into mockery to combine the speed and configuration flexibility of mockery with the simplicity of moq-style mocks. 2. The ability to specify [your own templates](template/index.md) for rendering. 3. One output file for all generated mocks (for a particular package) instead of one output file per mock. 4. Simplification and streamlining of the way mocks are generated using new configuration defaults. v3 has been architected in a way that will eventually make all other interface-based code generation frameworks obsolete.[^2] Read the maintainer's blog post on the history and background of v3: [![](https://topofmind.dev/assets/images/social/blog/2025/04/08/announcing-mockery-v3.png){ style="width: 600px; max-width: 100%" }](https://topofmind.dev/blog/2025/04/08/announcing-mockery-v3/) ## `mockery migrate` A tool is provided that will migrate your v2 config to v3 on a best-effort basis. Take for example a v2 schema config: ```yaml title="" quiet: False disable-version-string: True with-expecter: True structname: "{{.InterfaceNameCamel}}" filename: "{{.StructName}}_mock.go" outpkg: mocks tags: "custom2" issue-845-fix: True resolve-type-alias: False packages: github.com/vektra/mockery/v2/pkg/fixtures: config: all: True interfaces: RequesterVariadic: config: with-expecter: False configs: - structname: RequesterVariadicOneArgument unroll-variadic: False - structname: RequesterVariadic unroll-variadic: True ReplaceGeneric: config: replace-type: - github.com/vektra/mockery/v2/pkg/fixtures.ReplaceGeneric[-TImport]=github.com/vektra/mockery/v2/pkg/fixtures/redefined_type_b.B - github.com/vektra/mockery/v2/pkg/fixtures.ReplaceGeneric[TConstraint]=github.com/vektra/mockery/v2/pkg/fixtures/constraints.String ``` We can run the command to migrate this to the v3 schema: ```title="" $ mockery migrate --config ./.mockery_v2.yml 2025-03-28T00:26:44.762164000-05:00 INF using config config=./.mockery_v2.yml version=v0.0.0-dev 2025-03-28T00:26:44.762804000-05:00 INF writing v3 config config=./.mockery_v2.yml v3-config=.mockery_v3.yml version=v0.0.0-dev 2025-03-28T00:26:44.762914000-05:00 WRN breaking changes detected that possibly require manual intervention. See table below. config=./.mockery_v2.yml version=v0.0.0-dev ``` This command will return two results: !!! info "" === "`.mockery_v3.yml`" The translated v3 config file. ```yaml structname: '{{.InterfaceNameCamel}}' pkgname: mocks template: testify template-data: with-expecter: true packages: github.com/vektra/mockery/v2/pkg/fixtures: config: all: true interfaces: ReplaceGeneric: config: {} RequesterVariadic: config: template-data: with-expecter: false configs: - structname: RequesterVariadicOneArgument template-data: unroll-variadic: false - structname: RequesterVariadic template-data: unroll-variadic: true ``` === "Deprecation Table" A deprecation table that highlights situations that could not be resolved automatically. Each of these entries must be manually handled. Take for example the last entry mentioning `replace-type`. In v3, the [schema for `replace-type`](replace-type.md#schema){ data-preview } was changed from a parsed string to a more explicit key-value mapping. ```title="" ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Deprecations │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ IDX DEPRECATION TYPE MESSAGE │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 0 template-variable InterfaceNameCamel template variable has been deleted. Use "{{ .InterfaceName | camelcase }}" instead │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 1 deprecated-parameter `tags` is no longer supported, parameter not migrated. Use `mock-build-tags` instead. │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 2 deprecated-parameter `disable-func-mocks` permanently enabled in v3. │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 3 deprecated-parameter `fail-on-missing` is permanently set to True in v3. │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 4 deprecated-parameter `disable-version-string` is permanently set to True in v3. │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 5 deprecated-parameter `issue-845-fix` is permanently set to true in v3. │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 6 deprecated-parameter `replace-type` has moved to a new schema. Cannot automatically migrate. Please visit │ │ https://vektra.github.io/mockery/latest-v3/replace-type/ for more information. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` !!! warning `mockery migrate` is not comprehensive and likely has missing edge cases. We encourage you to submit issues and PRs for any problems you encounter. ## Config Templates Template functions used in configuration files have changed. The order of arugments for functions that take input strings is swapped. For example, in v2 the [`trimSuffix` function](https://github.com/vektra/mockery/blob/v2.53.3/pkg/outputter.go#L49) was set to the `strings.TrimSuffix` function from the stdlib. In v3, the argument orders are swapped, for example: ```go "trimSuffix": func(suffix string, s string) string { return strings.TrimSuffix(s, suffix) }, ``` This is done to support [template pipelines](https://pkg.go.dev/text/template#hdr-Pipelines). You can see all of the reordered functions at [pkg.go.dev](https://pkg.go.dev/github.com/vektra/mockery/v3@v3.2.4/template_funcs#pkg-variables). ## Layouts In v2, mockery defaulted to placing mocks in a separate `mocks/` directory as [shown here](https://vektra.github.io/mockery/latest-v2/configuration/#layouts). In v3, mockery will by default place mocks adjacent to the mocked interface. It is still possible to place mocks in a separate directory by making use of the [template variables and functions](configuration.md#templates) available to the configuration parameters. ## Function Mocks Mockery v2 allowed generating mocks for function types. v3 no longer does this as it provided little benefit for users. ## Parameters ### `#!yaml inpackage: True` Mockery v2 has an `inpackage` parameter that informed mockery when a mock was being generated in the same package as the original interface. In v3, this parameter has been removed as mockery is now able to detect when the mock is placed in the same package. ### `#!yaml keeptree: True` Mockery v2 provided a `keeptree` parameter that was deprecated and used only in the pre-`packages` config schema. This parameter has no use in v3 and has been removed. ### `#!yaml replace-type:` The `#!yaml replace-type:` parameter has an updated schema. In v2, [users provided a list of strings](https://vektra.github.io/mockery/latest-v2/features/#replace-types), where each string needed to confirm to a specific format that was parsed at runtime. In v3, the [schema is more explicit](replace-type.md) to make it simpler. ### `#!yaml resolve-type-alias:` In v2, `resolve-type-alias` was set to `True` by default to retain backwards compatibility. In v3, this is permanently set to `False`. ### `#!yaml with-expecter:` In v3, this parameter has been removed. `testify`-style mocks will always generate expecter methods. ### `#!yaml unroll-variadic:` This parameter has been moved under the `#!yaml template-data:` parameter. Parameters that apply only to specific templates are not expressed in the top-level schema and are instead passed through the schemaless `#!yaml template-data:` map. ### `#!yaml exclude:` This parameter in v2 was renamed to `#! exclude-subpkg-regex:`. ## v2 Support Lifecycle In order to give the community ample time to adjust to v3, the mockery maintainers will support v2 until Dec 31, 2029 in the following ways: 1. Bug fixes 2. Security/vulnerability fixes 3. Dependency updates to support future Go language versions.[^1] From the date at which v3 is released for full production, the Mockery project will support feature updates to v2 for a period of 6 months. [^1]: More specifically, we agree to update our dependencies used in parsing Go types such that Mockery is capable of parsing new syntax introduced in the Go language. The mockery project will _not_ support changes to the generated code in a manner that makes use of any new language features. The only promise is that Mockery will be able to parse modules that use such new syntax or other language features without failing. [^2]: A bold statement yes, but we hope to convince you of its truth with what's coming. The assumption of the https://github.com/matryer/moq project into mockery is a testament to this statement, and is only the first of many other projects we hope to integrate into mockery. ================================================ FILE: e2e/run_all.sh ================================================ #!/bin/bash set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) for test in $(ls -d $SCRIPT_DIR/test_*); do file="$test" if [ -d "$test" ]; then file="$test/run.sh" if ! [ -f $file ]; then continue fi fi echo "==========" echo "RUNNING $file" echo "==========" $file done ================================================ FILE: e2e/test_infinite_mocking.sh ================================================ #!/bin/bash # This tests https://github.com/vektra/mockery/issues/632, where # mockery was generating mocks of its own auto-generated code. go run github.com/go-task/task/v3/cmd/task mocks || exit 1 # New mocks may legimitately be created, so we run mockery once first num_files_before=$(find . -type f | wc -l) export MOCKERY_FORCE_FILE_WRITE="true" go run github.com/go-task/task/v3/cmd/task mocks.generate || exit 1 num_files_after=$(find . -type f | wc -l) if [ $num_files_before -ne $num_files_after ]; then echo "ERROR: detected increased file count over multiple mockery runs." echo "before: $num_files_before. after: $num_files_after" exit 1 fi echo "SUCCESS: identical number of files over multiple mockery runs" ================================================ FILE: e2e/test_missing_interface/.mockery.yml ================================================ packages: github.com/vektra/mockery/v3/internal: interfaces: InterfaceDoesntExist: ================================================ FILE: e2e/test_missing_interface/run.sh ================================================ #!/bin/bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) CONFIG=$SCRIPT_DIR/.mockery.yml export MOCKERY_CONFIG=$CONFIG go run github.com/go-task/task/v3/cmd/task mocks.generate.custom RT=$? if [ $RT -eq 0 ]; then echo "ERROR: Expected mockery to fail." exit 1 fi echo "SUCCESS: Mockery returned non-zero return code as expected." ================================================ FILE: e2e/test_mockery_generation.sh ================================================ #!/bin/bash go run github.com/go-task/task/v3/cmd/task mocks rt=$? if [ $rt -ne 0 ]; then echo "ERROR: non-zero return code from mockery" exit 1 fi echo "SUCCESS: successfully generated mocks defined in .mockery.yaml" ================================================ FILE: e2e/test_remote_templates/remote_templates_test.go ================================================ package testremotetemplates import ( "fmt" "net/http" "net/http/httptest" "os" "os/exec" "path" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var configTemplate = ` dir: %s filename: %s template: %s formatter: noop force-file-write: true pkgname: test_pkgname template-data: foo: foo bar: bar packages: github.com/vektra/mockery/v3/internal/fixtures/template_exercise: interfaces: Exercise: ` func TestRemoteTemplates(t *testing.T) { // the temp dir needs to reside within the mockery project because mockery // requires a go.mod file to function correctly. Using t.TempDir() won't work // because of this. tmpDirBase := "./test" _ = os.RemoveAll(tmpDirBase) require.NoError(t, os.Mkdir(tmpDirBase, 0o755)) //nolint:errcheck defer os.RemoveAll(tmpDirBase) type test struct { name string schema string expectMockeryErr bool } for _, tt := range []test{ { name: "schema validation OK", schema: `{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "vektra/mockery matryer mock", "type": "object", "additionalProperties": false, "properties": { "foo": { "type": "string" }, "bar": { "type": "string" } }, "required": ["foo", "bar"] }`, expectMockeryErr: false, }, { name: "Required parameter doesn't exist", schema: `{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "vektra/mockery matryer mock", "type": "object", "additionalProperties": false, "properties": { "foo": { "type": "string" }, "bar": { "type": "string" }, "baz": { "type": "string" } }, "required": ["foo", "bar", "baz"] }`, expectMockeryErr: true, }, } { t.Run(tt.name, func(t *testing.T) { tmpdir := path.Join(tmpDirBase, t.Name()) require.NoError(t, os.MkdirAll(tmpdir, 0o755)) configFile := path.Join(tmpdir, ".mockery.yml") outFile := path.Join(tmpdir, "out.txt") templateName := "template.templ" mux := http.NewServeMux() mux.HandleFunc(fmt.Sprintf("/%s", templateName), func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, world!") }) mux.HandleFunc(fmt.Sprintf("/%s.schema.json", templateName), func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, tt.schema) }) ts := httptest.NewServer(mux) defer ts.Close() fullPath := fmt.Sprintf("%s/%s", ts.URL, templateName) parent, name := path.Split(outFile) configFileContents := fmt.Sprintf( configTemplate, parent, name, fullPath, ) require.NoError(t, os.WriteFile(configFile, []byte(configFileContents), 0o600)) //nolint: gosec out, err := exec.Command( "go", "run", "github.com/vektra/mockery/v3", "--config", configFile).CombinedOutput() if tt.expectMockeryErr { assert.Error(t, err) } else { require.NoError(t, err, string(out)) outFileBytes, err := os.ReadFile(outFile) require.NoError(t, err) assert.Equal(t, "Hello, world!", string(outFileBytes)) } }) } } ================================================ FILE: e2e/test_template_data_schema_validation/.mockery.yml ================================================ dir: ./ filename: exercise.txt template: file://./template.templ formatter: noop force-file-write: true pkgname: test_pkgname template-data: bar: bar packages: github.com/vektra/mockery/v3/internal/fixtures/template_exercise: interfaces: Exercise: ================================================ FILE: e2e/test_template_data_schema_validation/template.templ ================================================ ================================================ FILE: e2e/test_template_data_schema_validation/template.templ.schema.json ================================================ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "vektra/mockery matryer mock", "type": "object", "additionalProperties": false, "properties": { "foo": { "type": "string" }, "bar": { "type": "string" } }, "required": ["foo", "bar"] } ================================================ FILE: e2e/test_template_data_schema_validation/validation_test.go ================================================ package test_template_exercise import ( "os" "os/exec" "strings" "testing" "github.com/stretchr/testify/assert" ) func TestExercise(t *testing.T) { t.Parallel() outfile := "./exercise.txt" //nolint:errcheck defer os.Remove(outfile) out, err := exec.Command( "go", "run", "github.com/vektra/mockery/v3", "--config", "./.mockery.yml").CombinedOutput() assert.Error(t, err) expectedString := "ERR (root): foo is required" assert.True(t, strings.Contains(string(out), expectedString), "expected string in stdout not found: \"%s\"", expectedString) } ================================================ FILE: e2e/test_template_exercise/.mockery.yml ================================================ dir: ./ filename: exercise.txt template: file://./exercise.templ formatter: noop force-file-write: true pkgname: test_pkgname template-data: foo: foo bar: bar packages: github.com/vektra/mockery/v3/internal/fixtures/template_exercise: interfaces: Exercise: ================================================ FILE: e2e/test_template_exercise/exercise.templ ================================================ .PkgName: {{ .PkgName }} .SrcPkgQualifier: {{ .SrcPkgQualifier }} {{ range $i, $import := .Imports }} $import.Alias: {{ $import.Alias }} $import.Path: {{ $import.Path }} $import.Qualifier: {{ $import.Qualifier }} {{ end }} {{ range $i, $interface := .Interfaces }} # MOCK: {{ $i }} $interface.Name: {{ $interface.Name }} $interface.StructName: {{ $interface.StructName }} # COMMENTS $interface.Comments.GenDeclDoc.Text: {{ $interface.Comments.GenDeclDoc.Text }} $interface.Comments.GenDeclDoc.List: {{- range $_, $comment := $interface.Comments.GenDeclDoc.List }} {{ $comment }} {{- end }} $interface.Comments.TypeSpecDoc.Text: {{ $interface.Comments.TypeSpecDoc.Text }} $interface.Comments.TypeSpecDoc.List: {{- range $_, $comment := $interface.Comments.TypeSpecDoc.List }} {{ $comment }} {{- end }} $interface.Comments.TypeSpecComment.Text: {{ $interface.Comments.TypeSpecComment.Text }} $interface.Comments.TypeSpecComment.List: {{- range $_, $comment := $interface.Comments.TypeSpecComment.List }} {{ $comment }} {{- end }} {{ range $j, $typeparam := .TypeParams }} # TYPE PARAM: {{ $j }} $typeparam.Var.Name: {{ $typeparam.Var.Name }} $typeparam.Var.IsSlice: {{ $typeparam.Var.IsSlice }} $typeparam.Var.Nillable: {{ $typeparam.Var.Nillable }} $typeparam.Var.Type.String: {{ $typeparam.Var.Type.String }} $typeparam.Var.TypeString: {{ $typeparam.Var.TypeString }} $typeparam.CallName: {{ $typeparam.CallName true }} $typeparam.CallName: {{ $typeparam.CallName false }} $typeparam.MethodArg: {{ $typeparam.MethodArg }} $typeparam.Name: {{ $typeparam.Name }} $typeparam.TypeString: {{ $typeparam.TypeString }} $typeparam.TypeStringEllipsis: {{ $typeparam.TypeStringEllipsis }} $typeparam.TypeStringVariadicUnderlying: {{ $typeparam.TypeStringVariadicUnderlying }} {{- if $typeparam.Constraint }} $typeparam.Constraint.String: {{ $typeparam.Constraint.String }} {{- end }} {{ end }} {{ range $j, $method := .Methods }} # METHOD: {{ $j }} $method.Name: {{ $method.Name }} $method.ReturnStatement: {{ $method.ReturnStatement }} $method.Call: {{ $method.Call }} $method.AcceptsContext: {{ $method.AcceptsContext}} $method.Signature: {{ $method.Signature }} $method.SignatureNoName: {{ $method.SignatureNoName }} $method.Declaration: {{ $method.Declaration }} $method.ReturnsError: {{ $method.ReturnsError }} $method.HasParams: {{ $method.HasParams }} $method.HasReturns: {{ $method.HasReturns }} $method.ReturnArgList: {{ $method.ReturnArgList }} $method.ReturnArgListNoName: {{ $method.ReturnArgListNoName }} $method.ArgList: {{ $method.ArgList }} $method.ArgListNoName: {{ $method.ArgListNoName }} {{ range $k, $param := .Params }} # PARAM: {{ $k }} $param.Var.Name: {{ $param.Var.Name }} $param.Var.IsSlice: {{ $param.Var.IsSlice }} $param.Var.Nillable: {{ $param.Var.Nillable }} $param.Var.Type.String: {{ $param.Var.Type.String }} $param.Var.TypeString: {{ $param.Var.TypeString }} $param.MethodArg: {{ $param.MethodArg }} $param.MethodArgNoName: {{ $param.MethodArgNoName }} {{ end }} {{ range $k, $return := .Returns }} # RETURN: {{ $k }} $return.Var.Name: {{ $return.Var.Name }} $return.Var.IsSlice: {{ $return.Var.IsSlice }} $return.Var.Nillable: {{ $return.Var.Nillable }} $return.Var.Type.String: {{ $return.Var.Type.String }} $return.Var.TypeString: {{ $return.Var.TypeString }} {{ end }} # SCOPE $method.Scope.AllocateName "foo": {{ $method.Scope.AllocateName "foo" }} $method.Scope.AllocateName "foo": {{ $method.Scope.AllocateName "foo" }} $method.Scope.NameExists "foo": {{ $method.Scope.NameExists "foo" }} $method.Scope.NameExists "foo1": {{ $method.Scope.NameExists "foo1" }} $method.Scope.NameExists "notexists": {{ $method.Scope.NameExists "notexists" }} {{ end }} {{ end }} ================================================ FILE: e2e/test_template_exercise/exercise.templ.schema.json ================================================ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "vektra/mockery matryer mock", "type": "object", "additionalProperties": false, "properties": { "foo": { "type": "string" }, "bar": { "type": "string" } }, "required": ["foo", "bar"] } ================================================ FILE: e2e/test_template_exercise/exercise_expected.txt ================================================ .PkgName: test_pkgname .SrcPkgQualifier: templateexercise. $import.Alias: $import.Path: context $import.Qualifier: context $import.Alias: $import.Path: golang.org/x/exp/constraints $import.Qualifier: constraints # MOCK: 0 $interface.Name: Exercise $interface.StructName: MockExercise # COMMENTS $interface.Comments.GenDeclDoc.Text: GenDecl comments $interface.Comments.GenDeclDoc.List: // GenDecl comments $interface.Comments.TypeSpecDoc.Text: Exercise is an interface that is used to render a template that exercises all parts of the template data passed to the template. $interface.Comments.TypeSpecDoc.List: // Exercise is an interface that is used to render a template that exercises // all parts of the template data passed to the template. $interface.Comments.TypeSpecComment.Text: This is a line comment $interface.Comments.TypeSpecComment.List: // This is a line comment # TYPE PARAM: 0 $typeparam.Var.Name: T $typeparam.Var.IsSlice: false $typeparam.Var.Nillable: true $typeparam.Var.Type.String: any $typeparam.Var.TypeString: any $typeparam.CallName: T $typeparam.CallName: T $typeparam.MethodArg: T any $typeparam.Name: T $typeparam.TypeString: any $typeparam.TypeStringEllipsis: any $typeparam.TypeStringVariadicUnderlying: any # TYPE PARAM: 1 $typeparam.Var.Name: Ordered $typeparam.Var.IsSlice: false $typeparam.Var.Nillable: true $typeparam.Var.Type.String: golang.org/x/exp/constraints.Ordered $typeparam.Var.TypeString: constraints.Ordered $typeparam.CallName: Ordered $typeparam.CallName: Ordered $typeparam.MethodArg: Ordered constraints.Ordered $typeparam.Name: Ordered $typeparam.TypeString: constraints.Ordered $typeparam.TypeStringEllipsis: constraints.Ordered $typeparam.TypeStringVariadicUnderlying: constraints.Ordered $typeparam.Constraint.String: int # METHOD: 0 $method.Name: Foo $method.ReturnStatement: return $method.Call: Foo(ctx, typeParam, ordered) $method.AcceptsContext: true $method.Signature: (ctx context.Context, typeParam T, ordered Ordered) (err error) $method.SignatureNoName: (context.Context, T, Ordered) (error) $method.Declaration: Foo(ctx context.Context, typeParam T, ordered Ordered) (err error) $method.ReturnsError: true $method.HasParams: true $method.HasReturns: true $method.ReturnArgList: err error $method.ReturnArgListNoName: error $method.ArgList: ctx context.Context, typeParam T, ordered Ordered $method.ArgListNoName: context.Context, T, Ordered # PARAM: 0 $param.Var.Name: ctx $param.Var.IsSlice: false $param.Var.Nillable: true $param.Var.Type.String: context.Context $param.Var.TypeString: context.Context $param.MethodArg: ctx context.Context $param.MethodArgNoName: context.Context # PARAM: 1 $param.Var.Name: typeParam $param.Var.IsSlice: false $param.Var.Nillable: true $param.Var.Type.String: T $param.Var.TypeString: T $param.MethodArg: typeParam T $param.MethodArgNoName: T # PARAM: 2 $param.Var.Name: ordered $param.Var.IsSlice: false $param.Var.Nillable: true $param.Var.Type.String: Ordered $param.Var.TypeString: Ordered $param.MethodArg: ordered Ordered $param.MethodArgNoName: Ordered # RETURN: 0 $return.Var.Name: err $return.Var.IsSlice: false $return.Var.Nillable: true $return.Var.Type.String: error $return.Var.TypeString: error # SCOPE $method.Scope.AllocateName "foo": foo $method.Scope.AllocateName "foo": foo1 $method.Scope.NameExists "foo": true $method.Scope.NameExists "foo1": true $method.Scope.NameExists "notexists": false ================================================ FILE: e2e/test_template_exercise/exercise_test.go ================================================ package test_template_exercise import ( "fmt" "os" "os/exec" "testing" "github.com/stretchr/testify/assert" ) func TestExercise(t *testing.T) { t.Parallel() outfile := "./exercise.txt" //nolint:errcheck defer os.Remove(outfile) out, err := exec.Command( "go", "run", "github.com/vektra/mockery/v3", "--config", "./.mockery.yml").CombinedOutput() if err != nil { fmt.Println(err) fmt.Println(string(out)) os.Exit(1) } b, err := os.ReadFile(outfile) if err != nil { fmt.Println(err) os.Exit(1) } expectedPath := "exercise_expected.txt" expected, err := os.ReadFile(expectedPath) if err != nil { fmt.Println(err) os.Exit(1) } assert.Equal(t, string(expected), string(b)) } ================================================ FILE: foo.go ================================================ package main type baz string type foo interface { Bar() baz } ================================================ FILE: foo_test.go ================================================ package main import ( "testing" "github.com/stretchr/testify/assert" ) func TestFoo(t *testing.T) { m := newMockfoo(t) m.EXPECT().Bar().Return(baz("foo")) assert.Equal(t, "foo", m.Bar()) } ================================================ FILE: go.mod ================================================ module github.com/vektra/mockery/v3 go 1.25.0 require ( github.com/brunoga/deep v1.3.1 github.com/go-viper/mapstructure/v2 v2.5.0 github.com/huandu/xstrings v1.5.0 github.com/jedib0t/go-pretty/v6 v6.7.8 github.com/knadh/koanf/parsers/yaml v1.1.0 github.com/knadh/koanf/providers/env v1.1.0 github.com/knadh/koanf/providers/file v1.2.1 github.com/knadh/koanf/providers/posflag v1.0.1 github.com/knadh/koanf/providers/structs v1.0.0 github.com/knadh/koanf/v2 v2.3.2 github.com/rs/zerolog v1.34.0 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a golang.org/x/term v0.40.0 golang.org/x/tools v0.42.0 gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/clipperhouse/uax29/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/knadh/koanf/maps v0.1.2 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.19 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/stretchr/objx v0.5.3 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/mod v0.33.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/text v0.34.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) ================================================ FILE: go.sum ================================================ github.com/brunoga/deep v1.3.1 h1:bSrL6FhAZa6JlVv4vsi7Hg8SLwroDb1kgDERRVipBCo= github.com/brunoga/deep v1.3.1/go.mod h1:GDV6dnXqn80ezsLSZ5Wlv1PdKAWAO4L5PnKYtv2dgaI= github.com/clipperhouse/uax29/v2 v2.2.0 h1:ChwIKnQN3kcZteTXMgb1wztSgaU+ZemkgWdohwgs8tY= github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jedib0t/go-pretty/v6 v6.7.8 h1:BVYrDy5DPBA3Qn9ICT+PokP9cvCv1KaHv2i+Hc8sr5o= github.com/jedib0t/go-pretty/v6 v6.7.8/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= github.com/knadh/koanf/maps v0.1.2 h1:RBfmAW5CnZT+PJ1CVc1QSJKf4Xu9kxfQgYVQSu8hpbo= github.com/knadh/koanf/maps v0.1.2/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/parsers/yaml v1.1.0 h1:3ltfm9ljprAHt4jxgeYLlFPmUaunuCgu1yILuTXRdM4= github.com/knadh/koanf/parsers/yaml v1.1.0/go.mod h1:HHmcHXUrp9cOPcuC+2wrr44GTUB0EC+PyfN3HZD9tFg= github.com/knadh/koanf/providers/env v1.1.0 h1:U2VXPY0f+CsNDkvdsG8GcsnK4ah85WwWyJgef9oQMSc= github.com/knadh/koanf/providers/env v1.1.0/go.mod h1:QhHHHZ87h9JxJAn2czdEl6pdkNnDh/JS1Vtsyt65hTY= github.com/knadh/koanf/providers/file v1.2.1 h1:bEWbtQwYrA+W2DtdBrQWyXqJaJSG3KrP3AESOJYp9wM= github.com/knadh/koanf/providers/file v1.2.1/go.mod h1:bp1PM5f83Q+TOUu10J/0ApLBd9uIzg+n9UgthfY+nRA= github.com/knadh/koanf/providers/posflag v1.0.1 h1:EnMxHSrPkYCFnKgBUl5KBgrjed8gVFrcXDzaW4l/C6Y= github.com/knadh/koanf/providers/posflag v1.0.1/go.mod h1:3Wn3+YG3f4ljzRyCUgIwH7G0sZ1pMjCOsNBovrbKmAk= github.com/knadh/koanf/providers/structs v1.0.0 h1:DznjB7NQykhqCar2LvNug3MuxEQsZ5KvfgMbio+23u4= github.com/knadh/koanf/providers/structs v1.0.0/go.mod h1:kjo5TFtgpaZORlpoJqcbeLowM2cINodv8kX+oFAeQ1w= github.com/knadh/koanf/v2 v2.3.2 h1:Ee6tuzQYFwcZXQpc2MiVeC6qHMandf5SMUJJNoFp/c4= github.com/knadh/koanf/v2 v2.3.2/go.mod h1:gRb40VRAbd4iJMYYD5IxZ6hfuopFcXBpc9bbQpZwo28= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw= github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a h1:ovFr6Z0MNmU7nH8VaX5xqw+05ST2uO1exVfZPVqRC5o= golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA= golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= ================================================ FILE: go.work ================================================ go 1.25.0 use ( . ./internal/fixtures/example_project/pkg_with_submodules ./tools ) ================================================ FILE: go.work.sum ================================================ cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/ai v0.8.0 h1:rXUEz8Wp2OlrM8r1bfmpF2+VKqc1VJpafE3HgzRnD/w= cloud.google.com/go/ai v0.8.0/go.mod h1:t3Dfk4cM61sytiggo2UyGsDVW3RF1qGZaUKDrZFyqkE= cloud.google.com/go/auth v0.8.1 h1:QZW9FjC5lZzN864p13YxvAtGUlQ+KgRL+8Sg45Z6vxo= cloud.google.com/go/auth v0.8.1/go.mod h1:qGVp/Y3kDRSDZ5gFD/XPUfYQ9xW1iI7q8RIRoCyBbJc= cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU= cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cristalhq/acmd v0.12.0 h1:RdlKnxjN+txbQosg8p/TRNZ+J1Rdne43MVQZ1zDhGWk= github.com/cristalhq/acmd v0.12.0/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= github.com/envoyproxy/go-control-plane v0.9.4 h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/felixge/fgprof v0.9.5 h1:8+vR6yu2vvSKn08urWyEuxx75NWPEvybbkBirEpsbVY= github.com/felixge/fgprof v0.9.5/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ= github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/generative-ai-go v0.17.0 h1:kUmCXUIwJouD7I7ev3OmxzzQVICyhIWAxaXk2yblCMY= github.com/google/generative-ai-go v0.17.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgx/v5 v5.4.3 h1:cxFyXhxlvAifxnkKKdlxv8XqUf59tDlYjnV5YYfsJJY= github.com/jackc/pgx/v5 v5.4.3/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo= github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8ceC6BxnoG8TBrhgAvRg8obzup0= github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mmcloughlin/avo v0.5.0 h1:nAco9/aI9Lg2kiuROBY6BhCI/z0t5jEvJfjWbL8qXLU= github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5 h1:0KqC6/sLy7fDpBdybhVkkv4Yz+PmB7c9Dz9z3dLW804= github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= github.com/otiai10/mint v1.3.1 h1:BCmzIS3n71sGfHB5NMNDB3lHYPz8fWSkCAErHed//qc= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71 h1:CNooiryw5aisadVfzneSZPswRWvnVW8hF1bS/vo8ReI= github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/quicktemplate v1.8.0 h1:zU0tjbIqTRgKQzFY1L42zq0qR3eh4WoQQdIdqCysW5k= github.com/valyala/quicktemplate v1.8.0/go.mod h1:qIqW8/igXt8fdrUln5kOSb+KWMaJ4Y8QUsfd1k6L2jM= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc= go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488 h1:3doPGa+Gg4snce233aCWnbZVFsyFMo/dR40KK/6skyE= golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488/go.mod h1:fGb/2+tgXXjhjHsTNdVEEMZNWA0quBnfrO+AfoDSAKw= golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 h1:bTLqdHv7xrGlFbvf5/TXNxy/iUwwdkjhqQTJDjW7aj0= golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4/go.mod h1:g5NllXBEermZrmR51cJDQxmJUHUOfRAaNyWBM+R+548= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= google.golang.org/api v0.192.0 h1:PljqpNAfZaaSpS+TnANfnNAXKdzHM/B9bKhwRlo7JP0= google.golang.org/api v0.192.0/go.mod h1:9VcphjvAxPKLmSxVSzPlSRXy/5ARMEw5bf58WoVXafQ= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d h1:kHjw/5UfflP/L5EbledDrcG4C2597RtymmGRZvHiCuY= google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d/go.mod h1:mw8MG/Qz5wfgYr6VqVCiZcHe/GJEfI+oGGDCohaVgB0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= mvdan.cc/editorconfig v0.2.1-0.20231228180347-1925077f8eb2 h1:8nmqQGVnHUtHuT+yvuA49lQK0y5il5IOr2PtCBkDI2M= mvdan.cc/editorconfig v0.2.1-0.20231228180347-1925077f8eb2/go.mod h1:r8RiQJRtzrPrZdcdEs5VCMqvRxAzYDUu9a4S9z7fKh8= rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= ================================================ FILE: internal/cmd/init.go ================================================ package cmd import ( "context" "fmt" "os" "github.com/spf13/cobra" "github.com/vektra/mockery/v3/config" "github.com/vektra/mockery/v3/internal/logging" "gopkg.in/yaml.v3" ) func addr[T any](v T) *T { return &v } func NewInitCmd() *cobra.Command { return &cobra.Command{ Use: "init [module_name]", Short: "Generate a basic .mockery.yml file", Long: `This command generates a basic .mockery.yml file that can be used as a starting point for your config.`, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { initRun(args, cmd.Parent().PersistentFlags()) }, } } type argGetter interface { GetString(name string) (string, error) } func initRun(args []string, params argGetter) { log, err := logging.GetLogger("info") if err != nil { fmt.Println(err) os.Exit(1) } filename, err := params.GetString("config") if err != nil { log.Err(err).Msg("failed to get --config value") os.Exit(1) } if filename == "" { filename = ".mockery.yml" } moduleName := args[0] log.Info().Str("file", filename).Msg("writing to file") defer log.Info().Msg("done") ctx := log.WithContext(context.Background()) k, err := config.NewDefaultKoanf(ctx) if err != nil { log.Err(err).Msg("failed getting koanf") os.Exit(1) } rootConf := &config.RootConfig{} if err := k.Unmarshal("", rootConf); err != nil { log.Err(err).Msg("failed to unmarshal koanf") os.Exit(1) } rootConf.Packages = map[string]*config.PackageConfig{ moduleName: { Config: &config.Config{ All: addr(true), }, Interfaces: map[string]*config.InterfaceConfig{}, }, } outFile := filename f, err := os.Create(outFile) if err != nil { log.Err(err).Msg("failed to open file") os.Exit(1) } defer f.Close() encoder := yaml.NewEncoder(f) defer encoder.Close() encoder.SetIndent(2) if err := encoder.Encode(rootConf); err != nil { log.Err(err).Msg("failed to encode") os.Exit(1) } } ================================================ FILE: internal/cmd/init_test.go ================================================ package cmd import ( "os" "path/filepath" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var expectedConfig string = `all: false dir: '{{.InterfaceDir}}' filename: mocks_test.go force-file-write: true formatter: goimports formatter-options: goimports: all-errors: false comments: true format-only: true fragment: false local-prefix: "" tab-indent: true tab-width: 8 generate: true include-auto-generated: false log-level: info structname: '{{.Mock}}{{.InterfaceName}}' pkgname: '{{.SrcPackageName}}' recursive: false require-template-schema-exists: true template: testify template-schema: '{{.Template}}.schema.json' packages: github.com/org/repo: config: all: true ` func Test_initRun(t *testing.T) { type args struct { args []string params func(t *testing.T, configPath string) argGetter } tests := []struct { name string configPath string args args }{ { name: "specify --config case", args: args{ args: []string{"github.com/org/repo"}, params: func(t *testing.T, configPath string) argGetter { m := newMockargGetter(t) m.EXPECT().GetString("config").Return(configPath, nil) return m }, }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tmpDir := t.TempDir() config := filepath.Join(tmpDir, "out.yml") initRun(tt.args.args, tt.args.params(t, config)) b, err := os.ReadFile(config) require.NoError(t, err) assert.Equal(t, expectedConfig, string(b)) }) } } ================================================ FILE: internal/cmd/migrate.go ================================================ package cmd import ( "context" "fmt" "os" "reflect" "strings" "github.com/jedib0t/go-pretty/v6/table" "github.com/jedib0t/go-pretty/v6/text" "github.com/rs/zerolog" "github.com/spf13/cobra" "github.com/vektra/mockery/v3/config" internalConfig "github.com/vektra/mockery/v3/internal/config" "github.com/vektra/mockery/v3/internal/logging" "golang.org/x/term" "gopkg.in/yaml.v3" ) func NewMigrateCmd() *cobra.Command { cmd := &cobra.Command{ Use: "migrate", Short: "Migrate v2 config to v3.", Long: `This command automatically migrates a v2 config to v3.`, Run: func(cmd *cobra.Command, args []string) { logLevel, err := cmd.Flags().GetString("log-level") if err != nil { fmt.Printf("%v\n", err) os.Exit(1) } if logLevel == "" { logLevel = "info" } log, err := logging.GetLogger(logLevel) if err != nil { fmt.Printf("%v\n", err) os.Exit(1) } ctx := log.WithContext(context.Background()) v2ConfPath, err := cmd.Flags().GetString("config") if err != nil { log.Err(err).Msg("failed to get parameter") os.Exit(1) } v3ConfigPath, err := cmd.Flags().GetString("outfile") if err != nil { log.Err(err).Msg("failed to get parameter") os.Exit(1) } if err := run( ctx, v2ConfPath, v3ConfigPath, ); err != nil { log.Err(err).Msg("failed to run") fmt.Printf("%v\n", err) os.Exit(1) } }, } flags := cmd.PersistentFlags() flags.String("outfile", ".mockery_v3.yml", "Location of the ouptut v3 file.") return cmd } type tableWriter struct { seenMessages map[string]any tbl table.Writer idx int termWidth int messageWrapWidth int } func newTableWriter(ctx context.Context) *tableWriter { log := zerolog.Ctx(ctx) tbl := table.NewWriter() width, _, err := term.GetSize(int(os.Stdout.Fd())) //nolint:gosec // integer overflow warnings are inevitable because of argument types if err != nil { log.Warn().Err(err).Msg("failed to get terminal size") } else { tbl.SetOutputMirror(os.Stdout) } tbl.SetTitle("Deprecations") tbl.Style().Title.Align = text.AlignCenter tbl.Style().Box = table.StyleBoxRounded tbl.Style().Size.WidthMax = width tbl.Style().Options.SeparateRows = true tbl.Style().Options.SeparateColumns = false tbl.AppendHeader( table.Row{ "Idx", "Deprecation Type", "Message", }, ) return &tableWriter{ seenMessages: map[string]any{}, tbl: tbl, idx: 0, termWidth: width, messageWrapWidth: width - 35, } } func (t *tableWriter) Append(depType string, msg string) { if _, seen := t.seenMessages[msg]; seen { return } t.seenMessages[msg] = struct{}{} t.tbl.AppendRow(table.Row{ fmt.Sprintf("%d", t.idx), depType, text.WrapSoft(msg, t.messageWrapWidth), }) t.idx++ } func (t *tableWriter) Render() { t.tbl.Render() } func run(ctx context.Context, confPathStr string, v3ConfPath string) error { var confPath string var err error log := zerolog.Ctx(ctx) if confPathStr == "" { confPath, err = internalConfig.FindConfig() if err != nil { return fmt.Errorf("finding config: %w", err) } } else { confPath = confPathStr } log.UpdateContext(func(c zerolog.Context) zerolog.Context { return c.Str("config", confPath) }) log.Info().Msg("using config") var v2 V2RootConfig f, err := os.Open(confPath) if err != nil { return fmt.Errorf("opening config file: %w", err) } defer f.Close() decoder := yaml.NewDecoder(f) decoder.KnownFields(true) if err := decoder.Decode(&v2); err != nil { log.Error().Msg("v2 config could not be decoded. Are you sure this is a v2 config file?") return fmt.Errorf("decoding v2 config: %w", err) } var v3 config.RootConfig var v3Config *config.Config = &config.Config{} v3Config.TemplateData = map[string]any{} // unroll-variadic is defaulted to true in v2, so we should set this as // the top-level default (unless of course it has been explicitly set // at the top-level v2 config) v3Config.TemplateData["unroll-variadic"] = addr(true) tbl := newTableWriter(ctx) migrateConfig(ctx, tbl, &v2.V2Config, &v3Config) v3Config.Template = addr("testify") v3.Config = *v3Config for pkgName, pkgConfig := range v2.Packages { pkgLog := log.With().Str("pkg-name", pkgName).Logger() pkgCtx := pkgLog.WithContext(ctx) v3PkgConfig := &config.PackageConfig{} if v3.Packages == nil { v3.Packages = map[string]*config.PackageConfig{} } v3.Packages[pkgName] = v3PkgConfig migrateConfig(pkgCtx, tbl, pkgConfig.Config, &v3PkgConfig.Config) for interfaceName, interfaceConfig := range pkgConfig.Interfaces { ifaceLog := pkgLog.With().Str("interface-name", interfaceName).Logger() ifaceCtx := ifaceLog.WithContext(pkgCtx) v3InterfaceConfig := config.InterfaceConfig{} if v3PkgConfig.Interfaces == nil { v3PkgConfig.Interfaces = map[string]*config.InterfaceConfig{} } v3PkgConfig.Interfaces[interfaceName] = &v3InterfaceConfig migrateConfig(ifaceCtx, tbl, interfaceConfig.Config, &v3InterfaceConfig.Config) for _, v2SubConfig := range interfaceConfig.Configs { v3SubConfig := &config.Config{} v3InterfaceConfig.Configs = append(v3InterfaceConfig.Configs, v3SubConfig) migrateConfig(ifaceCtx, tbl, &v2SubConfig, &v3SubConfig) } } } outFile := v3ConfPath file, err := os.Create(outFile) if err != nil { return fmt.Errorf("opening .mockery_v3.yml: %w", err) } defer file.Close() encoder := yaml.NewEncoder(file) defer encoder.Close() encoder.SetIndent(2) log.Info().Str("v3-config", outFile).Msg("writing v3 config") if err := encoder.Encode(v3); err != nil { return fmt.Errorf("encoding .mockery_v3.yml: %w", err) } if len(tbl.seenMessages) != 0 { log.Warn().Msg("breaking changes detected that possibly require manual intervention. See table below.") tbl.Render() } return nil } func checkDeprecatedTemplateVariables( ctx context.Context, conf *V2Config, tbl *tableWriter, ) { log := zerolog.Ctx(ctx) confValue := reflect.ValueOf(conf).Elem() for i := range confValue.NumField() { fieldValue := confValue.Field(i) isPointerToString := fieldValue.Kind() == reflect.Pointer && fieldValue.Elem().Kind() == reflect.String isString := fieldValue.Kind() == reflect.String if !isPointerToString && !isString { log.Debug().Str("field", fieldValue.String()).Bool("pointerToString", isPointerToString).Bool("string", isString).Msg("field is not a pointer") continue } var fieldAsString string if isString { fieldAsString = fieldValue.Interface().(string) } else { fieldAsString = fieldValue.Elem().Interface().(string) } log.Debug().Str("field-as-string", fieldAsString).Str("field-name", confValue.Type().Field(i).Name).Msg("field as string") for _, deprecatedVariable := range []struct { name string message string }{ { name: "InterfaceNameCamel", message: "InterfaceNameCamel template variable has been deleted. Use \"{{ .InterfaceName | camelcase }}\" instead", }, { name: "InterfaceNameLowerCamel", message: "InterfaceNameLowerCamel template variable has been deleted. Use \"{{ .InterfaceName | camelcase | firstLower }}\" instead", }, { name: "InterfaceNameSnake", message: "InterfaceNameSnake template variable has been deleted. Use \"{{ .InterfaceName | snakecase }}\" instead", }, { name: "InterfaceNameLower", message: "InterfaceNameLower template variable has been deleted. Use \"{{ .InterfaceName | lower }}\" instead", }, { name: "PackageName", message: "PackageName template variable has been deleted. Use \"{{ .SrcPackageName }}\" instead", }, } { if strings.Contains(fieldAsString, deprecatedVariable.name) { tbl.Append("template-variable", deprecatedVariable.message) } } } } func migrateConfig( ctx context.Context, tbl *tableWriter, v2Config *V2Config, v3Config **config.Config, ) { if v2Config == nil { return } checkDeprecatedTemplateVariables(ctx, v2Config, tbl) // We do this so we can lazily create a new `config` section if necessary. // It's kind of gross, but the double pointer is necessary to update the struct // that contains the *config.Config pointer. if *v3Config == nil { *v3Config = &config.Config{} } v3 := *v3Config v3.All = v2Config.All v3.Anchors = v2Config.Anchors if v2Config.BoilerplateFile != nil { if v3.TemplateData == nil { v3.TemplateData = map[string]any{} } v3.TemplateData["boilerplate-file"] = v2Config.BoilerplateFile } if v2Config.BuildTags != nil { tbl.Append("deprecated-parameter", "`tags` is no longer supported, parameter not migrated. Use `template-data.mock-build-tags` instead.") } if v2Config.Case != nil { tbl.Append("deprecated-parameter", "`case` is no longer supported. Use `structname` to specify the name and exported-ness of the output mocks.") } v3.ConfigFile = v2Config.Config if v2Config.Cpuprofile != nil { tbl.Append("deprecated-parameter", "`cpuprofile` is not supported in v3, however we welcome PRs to implement the feature: https://github.com/vektra/mockery/issues/956") } v3.Dir = v2Config.Dir if v2Config.DisableConfigSearch != nil { tbl.Append("deprecated-parameter", "`disable-config-search` is permanently disabled in v3.") } // disable-deprecation-warnings: no deprecations in v3 // disabled-deprecation-warnings: no deprecations in v3 if v2Config.DisableFuncMocks == nil || !*v2Config.DisableFuncMocks { tbl.Append("deprecated-parameter", "`disable-func-mocks` permanently enabled in v3.") } if v2Config.DisableVersionString == nil || !*v2Config.DisableVersionString { tbl.Append("deprecated-parameter", "`disable-version-string` is permanently set to True in v3.") } if v2Config.DryRun != nil && *v2Config.DryRun { tbl.Append("deprecated-parameter", "`dry-run` not supported in v3.") } v3.ExcludeSubpkgRegex = v2Config.Exclude v3.ExcludeInterfaceRegex = v2Config.ExcludeRegex if v2Config.Exported != nil { tbl.Append("deprecated-parameter", "`exported` is no longer supported. Use `structname` instead.") } if v2Config.FailOnMissing == nil || (v2Config.FailOnMissing != nil && *v2Config.FailOnMissing == false) { tbl.Append("deprecated-parameter", "`fail-on-missing` is permanently set to True in v3.") } // inpackage: deleted, should work automatically. if v2Config.InPackageSuffix != nil { tbl.Append("deprecated-parameter", "`inpackage-suffix` is no longer supported in v3.") } if v2Config.IncludeAutoGenerated != nil { v3.IncludeAutoGenerated = v2Config.IncludeAutoGenerated } v3.IncludeInterfaceRegex = v2Config.IncludeRegex if v2Config.Issue845Fix == nil || *v2Config.Issue845Fix == false { tbl.Append("deprecated-parameter", "`issue-845-fix` is permanently set to True in v3.") } if v2Config.KeepTree != nil && *v2Config.KeepTree == true { tbl.Append("deprecated-parameter", "`keeptree` is not supported in v3. Use `dir` to specify where interfaces are located.") } v3.LogLevel = v2Config.LogLevel if v2Config.MockBuildTags != nil { if v3.TemplateData == nil { v3.TemplateData = map[string]any{} } v3.TemplateData["mock-build-tags"] = *v2Config.MockBuildTags } v3.StructName = v2Config.MockName if v2Config.Name != nil { tbl.Append("deprecated-parameter", "`name` is no longer supported. Use `structname` instead.") } if v2Config.Note != nil { tbl.Append("deprecated-parameter", "`note` is no longer supported.") } v3.PkgName = v2Config.Outpkg if v2Config.Output != nil { tbl.Append("deprecated-parameter", "`output` was replaced by `dir` in v2. This value is ignored.") } if v2Config.Packageprefix != nil { tbl.Append("deprecated-parameter", "`packageprefix` was replaced by `outpkg` in v2. This value is ignored.") } if v2Config.Print != nil && *v2Config.Print == true { tbl.Append("deprecated-parameter", "`print` is not supported in v3.") } if v2Config.Profile != nil { tbl.Append("deprecated-parameter", "`profile` is not supported in v3, but PRs are welcome to implement it: https://github.com/vektra/mockery/issues/955") } if v2Config.Quiet != nil && *v2Config.Quiet == true { tbl.Append("deprecated-parameter", "`quiet` is not supported in v3. Use `log-level` instead.") } v3.Recursive = v2Config.Recursive if len(v2Config.ReplaceType) != 0 { tbl.Append("deprecated-parameter", "`replace-type` has moved to a new schema. Cannot automatically migrate. Please visit https://vektra.github.io/mockery/latest-v3/replace-type/ for more information.") } if v2Config.ResolveTypeAlias != nil && *v2Config.ResolveTypeAlias == true { tbl.Append("deprecated-parameter", "`resolve-type-alias` is permanently set to False in v3. Type aliases typically should never be resolved.") } if v2Config.SrcPkg != nil { tbl.Append("deprecated-parameter", "`srcpkg` is not supported in v3. Use the `packages` configuration instead.") } if v2Config.StructName != nil { tbl.Append("deprecated-parameter", "`structname` was replaced by `structname` in v2. This value is ignored.") } if v2Config.TestOnly != nil { tbl.Append("deprecated-parameter", "`testonly` was replaced by `filename` in v2. This value is ignored and not supported in v3.") } if v2Config.UnrollVariadic != nil { if v3.TemplateData == nil { v3.TemplateData = map[string]any{} } v3.TemplateData["unroll-variadic"] = *v2Config.UnrollVariadic } if v2Config.WithExpecter != nil && *v2Config.WithExpecter == false { tbl.Append("deprecated-parameter", "`with-expecter` was removed in v3 because it is permanently enabled.") } } type V2RootConfig struct { V2Config `yaml:",inline"` Packages map[string]V2PackageConfig `yaml:"packages"` } type V2PackageConfig struct { Config *V2Config `yaml:"config"` Interfaces map[string]V2InterfaceConfig `yaml:"interfaces"` } type V2InterfaceConfig struct { Config *V2Config `yaml:"config"` Configs []V2Config `yaml:"configs"` } type V2Config struct { All *bool `yaml:"all"` Anchors map[string]any `yaml:"_anchors"` BoilerplateFile *string `yaml:"boilerplate-file"` // MOVED: moved to `template-data.boilerplate-file` BuildTags *string `yaml:"tags"` // DELETED: use mock-build-tags instead Case *string `yaml:"case"` // DELETED: caseness is specified using template variables/functions in `structname`. Config *string `yaml:"config"` Cpuprofile *string `yaml:"cpuprofile"` // DELETED: not an option in v3 Dir *string `yaml:"dir"` DisableConfigSearch *bool `yaml:"disable-config-search"` // DEPRECATED: permanently set to `false` in v3 DisableDeprecationWarnings *bool `yaml:"disable-deprecation-warnings"` DisabledDeprecationWarnings *[]string `yaml:"disabled-deprecation-warnings"` DisableFuncMocks *bool `yaml:"disable-func-mocks"` // DEPRECATED: func-mocks no longer generated. DisableVersionString *bool `yaml:"disable-version-string"` // DEPRECATED: set to true in v3 DryRun *bool `yaml:"dry-run"` Exclude []string `yaml:"exclude"` // MOVED: moved to `exclude-subpkg-regex` in v3 ExcludeRegex *string `yaml:"exclude-regex"` Exported *bool `yaml:"exported"` // DELETED: Use templated parameters to define upper/lower case-ness of mock names. FailOnMissing *bool `yaml:"fail-on-missing"` // DEPRECATED: set to true permanently in v3 FileName *string `yaml:"filename"` InPackage *bool `yaml:"inpackage"` // DELETED: mockery automatically detects the appropriate value for the parameter. InPackageSuffix *bool `yaml:"inpackage-suffix"` // DELETED: Use `packages` config. IncludeAutoGenerated *bool `yaml:"include-auto-generated"` // DELETED: not supported in v3. PRs to port functionality to v3 welcome. IncludeRegex *string `yaml:"include-regex"` Issue845Fix *bool `yaml:"issue-845-fix"` // DEPRECATED: set to true in v3 KeepTree *bool `yaml:"keeptree"` // DELETED: mockery uses templated parameters to specify directory and filename locations. LogLevel *string `yaml:"log-level"` MockBuildTags *string `yaml:"mock-build-tags"` // MOVED: moved to `template-data.mock-build-tags` MockName *string `yaml:"mockname"` Name *string `yaml:"name"` // DELETED: not supported Note *string `yaml:"note"` // DELETED: not supported Outpkg *string `yaml:"outpkg"` // DEPRECATED: Use `pkgname` instead Output *string `yaml:"output"` // DELETED: Use `packages` config Packageprefix *string `yaml:"packageprefix"` // DEPRECATED: use `pkgname` Print *bool `yaml:"print"` // DEPRECATED: printing mocks not an option Profile *string `yaml:"profile"` // DELETED: not an option in v3 Quiet *bool `yaml:"quiet"` // DEPRECATED: deleted in v3 in favor of log-level Recursive *bool `yaml:"recursive"` ReplaceType []string `yaml:"replace-type"` // DEPRECATED: moved to new schema in v3 ResolveTypeAlias *bool `yaml:"resolve-type-alias"` // DEPRECATED: permanently set to false in v3 SrcPkg *string `yaml:"srcpkg"` // DELETED: Use `packages` config. StructName *string `yaml:"structname"` // MOVED: moved to `structname` in v3 TestOnly *bool `yaml:"testonly"` // DEPRECATED: use `filename` to generate `_test.go` suffix. UnrollVariadic *bool `yaml:"unroll-variadic"` // MOVED: moved to `template-data.unroll-variadic` Version *bool `yaml:"version"` WithExpecter *bool `yaml:"with-expecter"` // DEPRECATED: set to true in v3 } ================================================ FILE: internal/cmd/migrate_test.go ================================================ package cmd import ( "context" "os" "path" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var v2ConfigExample string = ` quiet: False disable-version-string: True with-expecter: True mockname: "{{.InterfaceName}}" filename: "{{.StructName}}_mock.go" outpkg: mocks tags: "custom2" issue-845-fix: True resolve-type-alias: False _anchors: &inpackage_config all: True dir: "{{.InterfaceDir}}" mockname: "Mock{{.InterfaceName}}" outpkg: "{{.PackageName}}_test" filename: "mock_{{.InterfaceNameSnake}}_test.go" inpackage: False packages: github.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment: config: mock-build-tags: "custom3 && (!windows || !darwin || !freebsd)" disable-version-string: true interfaces: IfaceWithCustomBuildTagInComment: github.com/vektra/mockery/v2/pkg: interfaces: TypesPackage: github.com/vektra/mockery/v2/pkg/fixtures: config: all: True interfaces: RequesterArgSameAsNamedImport: RequesterVariadic: config: with-expecter: False configs: - mockname: RequesterVariadicOneArgument unroll-variadic: False - mockname: RequesterVariadic unroll-variadic: True Expecter: config: with-expecter: True configs: - mockname: ExpecterAndRolledVariadic unroll-variadic: False - mockname: Expecter unroll-variadic: True RequesterReturnElided: VariadicNoReturnInterface: config: with-expecter: True unroll-variadic: False # Replace generic params with a new constraint and a new fixed value ReplaceGeneric: config: replace-type: - github.com/vektra/mockery/v2/pkg/fixtures.ReplaceGeneric[-TImport]=github.com/vektra/mockery/v2/pkg/fixtures/redefined_type_b.B - github.com/vektra/mockery/v2/pkg/fixtures.ReplaceGeneric[TConstraint]=github.com/vektra/mockery/v2/pkg/fixtures/constraints.String # Replace a generic param with the parent type ReplaceGenericSelf: config: replace-type: - github.com/vektra/mockery/v2/pkg/fixtures.ReplaceGenericSelf[-T]=github.com/vektra/mockery/v2/pkg/fixtures.*ReplaceGenericSelf github.com/vektra/mockery/v2/pkg/fixtures/recursive_generation: config: recursive: True all: True dir: "{{.InterfaceDir}}" filename: "{{.InterfaceName}}_mock.go" mockname: "Mock{{.InterfaceName}}" outpkg: "{{.PackageName}}" inpackage: True github.com/vektra/mockery/v2/pkg/fixtures/empty_return: config: all: True dir: "{{.InterfaceDir}}" mockname: "{{.InterfaceName}}Mock" outpkg: "{{.PackageName}}" filename: "mock_{{.InterfaceName}}_test.go" inpackage: True keeptree: False github.com/vektra/mockery/v2/pkg/fixtures/method_args/same_name_arg_and_type: config: all: True dir: "{{.InterfaceDir}}" mockname: "{{.InterfaceName}}Mock" outpkg: "{{.PackageName}}" filename: "mock_{{.InterfaceName}}_test.go" inpackage: True keeptree: False github.com/vektra/mockery/v2/pkg/fixtures/iface_typed_param: config: *inpackage_config github.com/vektra/mockery/v2/pkg/fixtures/example_project: config: *inpackage_config github.com/vektra/mockery/v2/pkg/fixtures/index_list_expr: config: *inpackage_config github.com/vektra/mockery/v2/pkg/fixtures/iface_new_type: config: *inpackage_config github.com/vektra/mockery/v2/pkg/fixtures/issue845: config: <<: *inpackage_config filename: "mock_{{.StructName}}_test.go" interfaces: Interface: configs: - issue-845-fix: False mockname: WithoutFix - issue-845-fix: True mockname: WithFix github.com/vektra/mockery/v2/pkg/fixtures/type_alias: config: all: True dir: "{{.InterfaceDir}}" filename: "mock_{{.StructName}}_test.go" outpkg: "{{.PackageName}}_test" inpackage: False interfaces: Interface1: configs: - resolve-type-alias: False mockname: InterfaceWithUnresolvedAlias - resolve-type-alias: True mockname: InterfaceWithResolvedAlias Interface2: configs: - resolve-type-alias: False mockname: Interface2WithUnresolvedAlias - resolve-type-alias: True mockname: Interface2WithResolvedAlias github.com/vektra/mockery/v2/pkg/: interfaces: InterfaceDoesntExist: github.com/vektra/mockery/v2/pkg/fixtures/auto_generated: config: all: True include-auto-generated: false interfaces: AutoGenerated: # include-auto-generated is false, so should be ignored ` var expectedV3Conf string = `_anchors: all: true dir: '{{.InterfaceDir}}' filename: mock_{{.InterfaceNameSnake}}_test.go inpackage: false mockname: Mock{{.InterfaceName}} outpkg: '{{.PackageName}}_test' structname: '{{.InterfaceName}}' pkgname: mocks template: testify template-data: unroll-variadic: true packages: github.com/vektra/mockery/v2/pkg: interfaces: TypesPackage: {} github.com/vektra/mockery/v2/pkg/: interfaces: InterfaceDoesntExist: {} github.com/vektra/mockery/v2/pkg/fixtures: config: all: true interfaces: Expecter: config: {} configs: - structname: ExpecterAndRolledVariadic template-data: unroll-variadic: false - structname: Expecter template-data: unroll-variadic: true ReplaceGeneric: config: {} ReplaceGenericSelf: config: {} RequesterArgSameAsNamedImport: {} RequesterReturnElided: {} RequesterVariadic: config: {} configs: - structname: RequesterVariadicOneArgument template-data: unroll-variadic: false - structname: RequesterVariadic template-data: unroll-variadic: true VariadicNoReturnInterface: config: template-data: unroll-variadic: false github.com/vektra/mockery/v2/pkg/fixtures/auto_generated: config: all: true include-auto-generated: false interfaces: AutoGenerated: {} github.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment: config: template-data: mock-build-tags: custom3 && (!windows || !darwin || !freebsd) interfaces: IfaceWithCustomBuildTagInComment: {} github.com/vektra/mockery/v2/pkg/fixtures/empty_return: config: all: true dir: '{{.InterfaceDir}}' structname: '{{.InterfaceName}}Mock' pkgname: '{{.PackageName}}' github.com/vektra/mockery/v2/pkg/fixtures/example_project: config: all: true dir: '{{.InterfaceDir}}' structname: Mock{{.InterfaceName}} pkgname: '{{.PackageName}}_test' github.com/vektra/mockery/v2/pkg/fixtures/iface_new_type: config: all: true dir: '{{.InterfaceDir}}' structname: Mock{{.InterfaceName}} pkgname: '{{.PackageName}}_test' github.com/vektra/mockery/v2/pkg/fixtures/iface_typed_param: config: all: true dir: '{{.InterfaceDir}}' structname: Mock{{.InterfaceName}} pkgname: '{{.PackageName}}_test' github.com/vektra/mockery/v2/pkg/fixtures/index_list_expr: config: all: true dir: '{{.InterfaceDir}}' structname: Mock{{.InterfaceName}} pkgname: '{{.PackageName}}_test' github.com/vektra/mockery/v2/pkg/fixtures/issue845: config: all: true dir: '{{.InterfaceDir}}' structname: Mock{{.InterfaceName}} pkgname: '{{.PackageName}}_test' interfaces: Interface: configs: - structname: WithoutFix - structname: WithFix github.com/vektra/mockery/v2/pkg/fixtures/method_args/same_name_arg_and_type: config: all: true dir: '{{.InterfaceDir}}' structname: '{{.InterfaceName}}Mock' pkgname: '{{.PackageName}}' github.com/vektra/mockery/v2/pkg/fixtures/recursive_generation: config: all: true dir: '{{.InterfaceDir}}' structname: Mock{{.InterfaceName}} pkgname: '{{.PackageName}}' recursive: true github.com/vektra/mockery/v2/pkg/fixtures/type_alias: config: all: true dir: '{{.InterfaceDir}}' pkgname: '{{.PackageName}}_test' interfaces: Interface1: configs: - structname: InterfaceWithUnresolvedAlias - structname: InterfaceWithResolvedAlias Interface2: configs: - structname: Interface2WithUnresolvedAlias - structname: Interface2WithResolvedAlias ` func TestMigrate(t *testing.T) { tmpdir := t.TempDir() v2File := path.Join(tmpdir, "v2_config.yml") v3File := path.Join(tmpdir, "v3_config.yml") require.NoError(t, os.WriteFile(v2File, []byte(v2ConfigExample), 0o600)) require.NoError(t, run(context.Background(), v2File, v3File)) b, err := os.ReadFile(v3File) require.NoError(t, err) assert.Equal(t, expectedV3Conf, string(b)) } ================================================ FILE: internal/cmd/mockery.go ================================================ package cmd import ( "context" "errors" "fmt" "os" "path/filepath" "strings" "github.com/vektra/mockery/v3/config" "github.com/vektra/mockery/v3/internal" pkg "github.com/vektra/mockery/v3/internal" "github.com/vektra/mockery/v3/internal/file" "github.com/vektra/mockery/v3/internal/logging" "github.com/vektra/mockery/v3/internal/stackerr" "github.com/rs/zerolog" "github.com/spf13/cobra" "github.com/spf13/pflag" "golang.org/x/tools/go/packages" ) var ErrCfgFileNotFound = errors.New("config file not found") func NewRootCmd() (*cobra.Command, error) { var pFlags *pflag.FlagSet cmd := &cobra.Command{ Use: "mockery", Short: "Generate mock objects for your Go interfaces", Run: func(cmd *cobra.Command, args []string) { if err := pFlags.Parse(args); err != nil { fmt.Printf("failed to parse flags: %s", err.Error()) os.Exit(1) } log, err := logging.GetLogger("info") if err != nil { fmt.Printf("failed to get logger: %s\n", err.Error()) os.Exit(1) } ctx := log.WithContext(context.Background()) r, err := GetRootApp(ctx, pFlags) if err != nil { logFatalErr(ctx, err) } if err := r.Run(); err != nil { logFatalErr(ctx, err) } }, } pFlags = cmd.PersistentFlags() pFlags.String("config", "", "config file to use") pFlags.String("log-level", os.Getenv("MOCKERY_LOG_LEVEL"), "Level of logging") cmd.AddCommand(NewShowConfigCmd()) cmd.AddCommand(NewVersionCmd()) cmd.AddCommand(NewInitCmd()) cmd.AddCommand(NewMigrateCmd()) return cmd, nil } func logFatalErr(ctx context.Context, err error) { log := zerolog.Ctx(ctx) log.Fatal().Err(err).Msg("app failed") } // Execute executes the cobra CLI workflow func Execute() { cmd, err := NewRootCmd() if err != nil { os.Exit(1) } if err := cmd.Execute(); err != nil { os.Exit(1) } } type RootApp struct { Config config.RootConfig } func GetRootApp(ctx context.Context, flags *pflag.FlagSet) (*RootApp, error) { r := &RootApp{} config, _, err := config.NewRootConfig(ctx, flags) if err != nil { return nil, fmt.Errorf("getting config: %w", err) } r.Config = *config return r, nil } // CollectionConfig contains the common, file-global configuration // parameters for an InterfaceCollection. Some mockery config parameters // are attributes of the entire file, rather than specific interfaces. // For such attributes, we must assert that all interfaces within // a collection have these values identically set. type CollectionConfig struct { InPackage *bool OutFilePath string OutPkgName string SrcPkgPath string Template string TemplateSchema string RequireTemplateSchemaExists bool } // InterfaceCollection maintains a list of *pkg.Interface and asserts that all // the interfaces in the collection belong to the same source package. It also // asserts that various properties of the interfaces added to the collection are // uniform. type InterfaceCollection struct { srcPkg *packages.Package interfaces []*internal.Interface config CollectionConfig } func NewInterfaceCollection( srcPkgPath string, outFilePath string, srcPkg *packages.Package, outPkgName string, template string, templateSchema string, inPackage *bool, requireTemplateSchemaExists bool, ) *InterfaceCollection { config := CollectionConfig{ InPackage: inPackage, SrcPkgPath: srcPkgPath, OutFilePath: outFilePath, OutPkgName: outPkgName, Template: template, TemplateSchema: templateSchema, RequireTemplateSchemaExists: requireTemplateSchemaExists, } return &InterfaceCollection{ srcPkg: srcPkg, interfaces: make([]*internal.Interface, 0), config: config, } } func (i *InterfaceCollection) Append(ctx context.Context, iface *internal.Interface) error { collectionFilepath := i.config.OutFilePath interfaceFilepath := iface.Config.FilePath() log := zerolog.Ctx(ctx).With(). Str(logging.LogKeyInterface, iface.Name). Str("collection-pkgname", i.config.OutPkgName). Str("interface-pkgname", *iface.Config.PkgName). Str("collection-pkgpath", i.config.SrcPkgPath). Str("interface-pkgpath", iface.Pkg.PkgPath). Str("collection-filepath", collectionFilepath). Str("interface-filepath", interfaceFilepath). Logger() if collectionFilepath != interfaceFilepath { msg := "all mocks in an InterfaceCollection must have the same output file path" log.Error().Msg(msg) return errors.New(msg) } if i.config.OutPkgName != *iface.Config.PkgName { msg := "all mocks in an output file must have the same pkgname" log.Error().Str("interface-pkgname", *iface.Config.PkgName).Msg(msg) return errors.New(msg) } if i.config.SrcPkgPath != iface.Pkg.PkgPath { msg := "all mocks in an output file must come from the same source package" log.Error().Msg(msg) return errors.New(msg) } if i.config.Template != *iface.Config.Template { msg := "all mocks in an output file must use the same template" log.Error().Str("expected-template", i.config.Template).Str("interface-template", *iface.Config.Template).Msg(msg) return errors.New(msg) } i.interfaces = append(i.interfaces, iface) return nil } func (r *RootApp) Run() error { remoteTemplateCache := make(map[string]*internal.RemoteTemplate) log, err := logging.GetLogger(*r.Config.LogLevel) if err != nil { fmt.Fprintf(os.Stderr, "Failed to initialize logger: %v\n", err) return err } log.Info().Str("config-file", r.Config.ConfigFileUsed()).Msgf("Starting mockery") ctx := log.WithContext(context.Background()) buildTags := strings.Split(*r.Config.BuildTags, " ") configuredPackages, err := r.Config.GetPackages(ctx) if err != nil { return fmt.Errorf("failed to get package from config: %w", err) } if len(configuredPackages) == 0 { log.Error().Msg("no packages specified in config") return fmt.Errorf("no packages specified in config") } parser := pkg.NewParser(buildTags, r.Config) // Let's build a missing map here to keep track of seen interfaces. // (pkg -> list of interface names) // After seeing an interface it'll be deleted from the map, keeping only // missing interfaces or packages in there. // // NOTE: We do that here without relying on parser, because parses iterates // over existing go files and interfaces, while user could've had a typo in // interface or pacakge name, making it impossible for parser to find these // files/interfaces in the first place. log.Debug().Msg("Making seen map...") missingMap := make(map[string]map[string]struct{}, len(configuredPackages)) for _, p := range configuredPackages { config, err := r.Config.GetPackageConfig(ctx, p) if err != nil { return err } if _, ok := missingMap[p]; !ok { missingMap[p] = make(map[string]struct{}, len(config.Interfaces)) } for ifaceName := range config.Interfaces { missingMap[p][ifaceName] = struct{}{} } } log.Info().Msg("Parsing configured packages...") interfaces, err := parser.ParsePackages(ctx, configuredPackages) if err != nil { log.Error().Err(err).Msg("unable to parse packages") return err } log.Info().Msg("Done parsing configured packages.") // maps the following: // outputFilePath|fullyQualifiedInterfaceName|[]*pkg.Interface // The reason why we need an interior map of fully qualified interface name // to a slice of *pkg.Interface (which represents all information necessary // to create the output mock) is because mockery allows multiple mocks to // be created for each input interface. mockFileToInterfaces := map[string]*InterfaceCollection{} for _, iface := range interfaces { ifaceLog := log. With(). Str(logging.LogKeyInterface, iface.Name). Str(logging.LogKeyPackagePath, iface.Pkg.Types.Path()). Logger() if _, exist := missingMap[iface.Pkg.PkgPath]; exist { delete(missingMap[iface.Pkg.PkgPath], iface.Name) if len(missingMap[iface.Pkg.PkgPath]) == 0 { delete(missingMap, iface.Pkg.PkgPath) } } ifaceCtx := ifaceLog.WithContext(ctx) pkgConfig, err := r.Config.GetPackageConfig(ctx, iface.Pkg.PkgPath) if err != nil { return fmt.Errorf("getting package %s: %w", iface.Pkg.PkgPath, err) } ifaceLog.Debug().Str("root-mock-name", *r.Config.Config.StructName).Str("pkg-mock-name", *pkgConfig.Config.StructName).Msg("mock-name during first GetPackageConfig") // Extract configuration from directive comments in the interface documentation directiveConfig, err := config.ExtractDirectiveConfig(ifaceCtx, iface.GenDecl) if err != nil { return fmt.Errorf("extracting directive config for interface %s: %w", iface.Name, err) } ifaceConfig, err := pkgConfig.GetInterfaceConfig(ctx, iface.Name, directiveConfig) if err != nil { return fmt.Errorf("getting interface config for %s: %w", iface.Name, err) } shouldGenerate, err := pkgConfig.ShouldGenerateInterface(ifaceCtx, iface.Name, *ifaceConfig.Config, directiveConfig != nil) if err != nil { return err } if !shouldGenerate { ifaceLog.Debug().Msg("config doesn't specify to generate this interface, skipping") continue } for _, ifaceConfig := range ifaceConfig.Configs { if err := ifaceConfig.ParseTemplates(ifaceCtx, iface.FilePath, iface.Name, iface.Pkg); err != nil { log.Err(err).Msg("Can't parse config templates for interface") return err } filePath := ifaceConfig.FilePath() ifaceLog.Info().Str("collection", filePath).Msg("adding interface to collection") _, ok := mockFileToInterfaces[filePath] if !ok { mockFileToInterfaces[filePath] = NewInterfaceCollection( iface.Pkg.PkgPath, filePath, iface.Pkg, *ifaceConfig.PkgName, *ifaceConfig.Template, *ifaceConfig.TemplateSchema, ifaceConfig.InPackage, *ifaceConfig.RequireTemplateSchemaExists, ) ifaceLog.Debug().Str("file-path", filePath).Msg("creating new interface collection") } ifaceWithTypes := internal.NewInterface( iface.Name, iface.TypeSpec, iface.GenDecl, iface.FilePath, iface.FileSyntax, iface.Pkg, ifaceConfig) ifaceLog.Debug().Str("ifaceWithTypes", fmt.Sprintf("%+v", ifaceWithTypes)).Msg("created iface with types") if err := mockFileToInterfaces[filePath].Append( ctx, ifaceWithTypes, ); err != nil { return err } } } for outFilePath, collection := range mockFileToInterfaces { fileLog := log.With().Str("file", outFilePath).Logger() fileCtx := fileLog.WithContext(ctx) packageConfig, err := r.Config.GetPackageConfig(fileCtx, collection.config.SrcPkgPath) if err != nil { return err } interfacesInFileDir := filepath.ToSlash(filepath.Dir(collection.config.OutFilePath)) generator, err := pkg.NewTemplateGenerator( fileCtx, collection.srcPkg, interfacesInFileDir, collection.config.Template, collection.config.TemplateSchema, collection.config.RequireTemplateSchemaExists, remoteTemplateCache, pkg.Formatter(*r.Config.Formatter), packageConfig.Config, collection.config.OutPkgName, collection.config.InPackage, ) if err != nil { return err } fileLog.Info().Msg("Executing template") templateBytes, err := generator.Generate(fileCtx, collection.interfaces) if err != nil { return err } outFileDir := filepath.ToSlash(filepath.Dir(outFilePath)) if outFileDir != "" { if err := os.MkdirAll(outFileDir, 0o755); err != nil { log.Err(err).Msg("failed to mkdir parent directories of mock file") return stackerr.NewStackErr(err) } } fileLog.Info().Msg("Writing template to file") exists, err := file.Exists(outFilePath) if err != nil { fileLog.Err(err).Msg("can't determine if outfile exists") return fmt.Errorf("determining if outfile exists: %w", err) } if exists && !*packageConfig.Config.ForceFileWrite { fileLog.Error().Bool("force-file-write", *packageConfig.Config.ForceFileWrite).Msg("output file exists, can't write mocks") return fmt.Errorf("outfile exists") } file, err := os.Create(outFilePath) if err != nil { return stackerr.NewStackErr(err) } defer file.Close() if _, err = file.Write(templateBytes); err != nil { return stackerr.NewStackErr(err) } } // The loop above could exit early, so sometimes warnings won't be shown // until other errors are fixed var foundMissing bool for packagePath := range missingMap { for ifaceName := range missingMap[packagePath] { foundMissing = true log.Error(). Str(logging.LogKeyInterface, ifaceName). Str(logging.LogKeyPackagePath, packagePath). Str(logging.LogKeyDocsURL, logging.DocsURL("/faq/#error-interface-not-found-in-source")). Msg("interface not found in source. View the linked documentation for possible reasons why this might occur.") } } if foundMissing { os.Exit(1) } return nil } ================================================ FILE: internal/cmd/mocks_testify_cmd_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package cmd import ( mock "github.com/stretchr/testify/mock" ) // newMockargGetter creates a new instance of mockargGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockargGetter(t interface { mock.TestingT Cleanup(func()) }) *mockargGetter { mock := &mockargGetter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // mockargGetter is an autogenerated mock type for the argGetter type type mockargGetter struct { mock.Mock } type mockargGetter_Expecter struct { mock *mock.Mock } func (_m *mockargGetter) EXPECT() *mockargGetter_Expecter { return &mockargGetter_Expecter{mock: &_m.Mock} } // GetString provides a mock function for the type mockargGetter func (_mock *mockargGetter) GetString(name string) (string, error) { ret := _mock.Called(name) if len(ret) == 0 { panic("no return value specified for GetString") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok { return returnFunc(name) } if returnFunc, ok := ret.Get(0).(func(string) string); ok { r0 = returnFunc(name) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(name) } else { r1 = ret.Error(1) } return r0, r1 } // mockargGetter_GetString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetString' type mockargGetter_GetString_Call struct { *mock.Call } // GetString is a helper method to define mock.On call // - name string func (_e *mockargGetter_Expecter) GetString(name interface{}) *mockargGetter_GetString_Call { return &mockargGetter_GetString_Call{Call: _e.mock.On("GetString", name)} } func (_c *mockargGetter_GetString_Call) Run(run func(name string)) *mockargGetter_GetString_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *mockargGetter_GetString_Call) Return(s string, err error) *mockargGetter_GetString_Call { _c.Call.Return(s, err) return _c } func (_c *mockargGetter_GetString_Call) RunAndReturn(run func(name string) (string, error)) *mockargGetter_GetString_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/cmd/showconfig.go ================================================ package cmd import ( "context" "fmt" koanfYAML "github.com/knadh/koanf/parsers/yaml" "github.com/knadh/koanf/providers/structs" "github.com/knadh/koanf/v2" "github.com/spf13/cobra" "github.com/vektra/mockery/v3/config" "github.com/vektra/mockery/v3/internal/logging" ) func NewShowConfigCmd() *cobra.Command { return &cobra.Command{ Use: "showconfig", Short: "Show the yaml config", Long: `Print out a yaml representation of the yaml config file. This does not show config from exterior sources like CLI, environment etc.`, RunE: func(cmd *cobra.Command, args []string) error { log, err := logging.GetLogger("debug") if err != nil { return err } ctx := log.WithContext(context.Background()) conf, _, err := config.NewRootConfig(ctx, cmd.Parent().PersistentFlags()) if err != nil { return err } k := koanf.New("|") if err := k.Load(structs.Provider(conf, "koanf"), nil); err != nil { log.Err(err).Msg("failed to load config") return err } b, _ := k.Marshal(koanfYAML.Parser()) fmt.Println(string(b)) return nil }, } } ================================================ FILE: internal/cmd/version.go ================================================ package cmd import ( "fmt" "github.com/spf13/cobra" "github.com/vektra/mockery/v3/internal/logging" ) func NewVersionCmd() *cobra.Command { return &cobra.Command{ Use: "version", Short: "Print the version of mockery", Run: func(cmd *cobra.Command, args []string) { fmt.Println(logging.GetSemverInfo()) }, } } ================================================ FILE: internal/config/config.go ================================================ package internal import ( "fmt" "os" "github.com/vektra/mockery/v3/internal/file" ) func FindConfig() (string, error) { cwd, err := os.Getwd() if err != nil { return "", fmt.Errorf("getting current working directory: %w", err) } configPath, _, err := file.FindInHierarchy(cwd, []string{".mockery.yaml", ".mockery.yml"}) return configPath, err } ================================================ FILE: internal/errors.go ================================================ package internal import "fmt" var ( ErrNoConfigFile = fmt.Errorf("no config file exists") ErrNoGoFilesFoundInRoot = fmt.Errorf("no go files found in root search path") ErrPkgNotFound = fmt.Errorf("package not found in config") ErrGoModNotFound = fmt.Errorf("no go.mod file found") ErrGoModInvalid = fmt.Errorf("go.mod file has no module line") ) ================================================ FILE: internal/file/exists.go ================================================ package file import ( "errors" "fmt" "os" ) func Exists(name string) (bool, error) { info, err := os.Stat(name) if err == nil { if info.Mode().IsRegular() { return true, nil } return false, fmt.Errorf("%q is not a regular file", name) } if errors.Is(err, os.ErrNotExist) { return false, nil } return false, err } ================================================ FILE: internal/file/exists_test.go ================================================ package file import ( "testing" "github.com/stretchr/testify/assert" ) func TestExistsDot(t *testing.T) { exists, err := Exists(".") assert.Error(t, err) assert.False(t, exists) } func TestExistsFile(t *testing.T) { exists, err := Exists("exists.go") assert.NoError(t, err) assert.True(t, exists) } func TestExistsJunk(t *testing.T) { exists, err := Exists("junk") assert.NoError(t, err) assert.False(t, exists) } ================================================ FILE: internal/file/find.go ================================================ package file import ( "errors" "fmt" "io" "os" "path" "path/filepath" ) func CleanPath(filePath string) (string, error) { filePath, err := filepath.Abs(filePath) if err != nil { return "", fmt.Errorf("making %q an absolute path: %w", filePath, err) } return filepath.ToSlash(filePath), nil } // FindInHierarchy looks for a file with any of the names in the hierarchy up to the root folder. // It returns the complete path of the file, the content and an error. func FindInHierarchy(folder string, names []string) (string, []byte, error) { folder, err := CleanPath(folder) if err != nil { return "", nil, err } for { for _, name := range names { filePath := path.Join(folder, name) file, err := os.Open(filePath) if err != nil { if errors.Is(err, os.ErrNotExist) { continue } return "", nil, fmt.Errorf("checking if %q exists: %w", filePath, err) } defer file.Close() info, err := file.Stat() if err != nil { return "", nil, fmt.Errorf("checking %q type: %w", filePath, err) } if !info.Mode().IsRegular() { return "", nil, fmt.Errorf("%q is not a regular file", filePath) } content, err := io.ReadAll(file) if err != nil { return "", nil, fmt.Errorf("reading %q: %w", filePath, err) } return filePath, content, nil } parent := path.Dir(folder) if folder == parent { return "", nil, errors.New("file not found") } folder = parent } } ================================================ FILE: internal/file/find_test.go ================================================ package file import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestGoMod(t *testing.T) { path, content, err := FindInHierarchy(".", []string{"go.mod"}) require.NoError(t, err) assert.NotEmpty(t, path) assert.NotEmpty(t, content) } func TestNotFound(t *testing.T) { _, _, err := FindInHierarchy(".", []string{"no.such.file"}) require.Error(t, err) } ================================================ FILE: internal/fixtures/12345678/http/http.go ================================================ package http type MyStruct struct{} ================================================ FILE: internal/fixtures/any_keyword.go ================================================ package test type UsesAny interface { GetReader() any } ================================================ FILE: internal/fixtures/argument_is_func_type.go ================================================ package test type Fooer interface { Foo(f func(x string) string) error Bar(f func([]int)) Baz(path string) func(x string) string } ================================================ FILE: internal/fixtures/argument_is_map_func.go ================================================ package test type MapFunc interface { Get(m map[string]func(string) string) error } ================================================ FILE: internal/fixtures/async.go ================================================ package test type AsyncProducer interface { Input() chan<- bool Output() <-chan bool Whatever() chan bool } ================================================ FILE: internal/fixtures/auto_generated_skip/auto_generated.go ================================================ // Code generated by mockery; DO NOT EDIT. // This is not actually auto-generated, we're just testing that mockery // skips this file. package autogeneratedskip type Bar interface { Get() string } ================================================ FILE: internal/fixtures/auto_generated_skip/foo.go ================================================ package autogeneratedskip type Foo interface { Get() string } ================================================ FILE: internal/fixtures/auto_generated_skip/foo_test.go ================================================ package autogeneratedskip import ( "os" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestFooExists(t *testing.T) { mockFile := "./mocks_testify_autogeneratedskip_test.go" mockContents, err := os.ReadFile(mockFile) require.NoError(t, err) assert.NotContains(t, string(mockContents), "func NewMockBar", "mock for type Bar was generated when it shouldn't have been because it's in an auto-generated file.") assert.Contains(t, string(mockContents), "func NewMockFoo") } ================================================ FILE: internal/fixtures/auto_generated_skip/mocks_testify_autogeneratedskip_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package autogeneratedskip import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockFoo func (_mock *MockFoo) Get() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockFoo_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockFoo_Expecter) Get() *MockFoo_Get_Call { return &MockFoo_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockFoo_Get_Call) Run(run func()) *MockFoo_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Get_Call) Return(s string) *MockFoo_Get_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Get_Call) RunAndReturn(run func() string) *MockFoo_Get_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/buildtag/comment/custom2_iface.go ================================================ //go:build custom2 // +build custom2 package comment type IfaceWithCustomBuildTagInComment interface { Sprintf(format string, a ...interface{}) string Custom2() } ================================================ FILE: internal/fixtures/buildtag/comment/custom_iface.go ================================================ //go:build custom // +build custom package comment type IfaceWithCustomBuildTagInComment interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/comment/darwin_iface.go ================================================ //go:build darwin // +build darwin package comment type IfaceWithBuildTagInComment interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/comment/freebsd_iface.go ================================================ //go:build freebsd // +build freebsd package comment type IfaceWithBuildTagInComment interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/comment/linux_iface.go ================================================ //go:build linux // +build linux package comment type IfaceWithBuildTagInComment interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/comment/mocks_testify_comment_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package comment import ( mock "github.com/stretchr/testify/mock" ) // NewMockIfaceWithBuildTagInComment creates a new instance of MockIfaceWithBuildTagInComment. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockIfaceWithBuildTagInComment(t interface { mock.TestingT Cleanup(func()) }) *MockIfaceWithBuildTagInComment { mock := &MockIfaceWithBuildTagInComment{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockIfaceWithBuildTagInComment is an autogenerated mock type for the IfaceWithBuildTagInComment type type MockIfaceWithBuildTagInComment struct { mock.Mock } type MockIfaceWithBuildTagInComment_Expecter struct { mock *mock.Mock } func (_m *MockIfaceWithBuildTagInComment) EXPECT() *MockIfaceWithBuildTagInComment_Expecter { return &MockIfaceWithBuildTagInComment_Expecter{mock: &_m.Mock} } // Sprintf provides a mock function for the type MockIfaceWithBuildTagInComment func (_mock *MockIfaceWithBuildTagInComment) Sprintf(format string, a ...interface{}) string { var tmpRet mock.Arguments if len(a) > 0 { tmpRet = _mock.Called(format, a) } else { tmpRet = _mock.Called(format) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for Sprintf") } var r0 string if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) string); ok { r0 = returnFunc(format, a...) } else { r0 = ret.Get(0).(string) } return r0 } // MockIfaceWithBuildTagInComment_Sprintf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sprintf' type MockIfaceWithBuildTagInComment_Sprintf_Call struct { *mock.Call } // Sprintf is a helper method to define mock.On call // - format string // - a ...interface{} func (_e *MockIfaceWithBuildTagInComment_Expecter) Sprintf(format interface{}, a ...interface{}) *MockIfaceWithBuildTagInComment_Sprintf_Call { return &MockIfaceWithBuildTagInComment_Sprintf_Call{Call: _e.mock.On("Sprintf", append([]interface{}{format}, a...)...)} } func (_c *MockIfaceWithBuildTagInComment_Sprintf_Call) Run(run func(format string, a ...interface{})) *MockIfaceWithBuildTagInComment_Sprintf_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []interface{} var variadicArgs []interface{} if len(args) > 1 { variadicArgs = args[1].([]interface{}) } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockIfaceWithBuildTagInComment_Sprintf_Call) Return(s string) *MockIfaceWithBuildTagInComment_Sprintf_Call { _c.Call.Return(s) return _c } func (_c *MockIfaceWithBuildTagInComment_Sprintf_Call) RunAndReturn(run func(format string, a ...interface{}) string) *MockIfaceWithBuildTagInComment_Sprintf_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/buildtag/comment/windows_iface.go ================================================ //go:build windows // +build windows package comment type IfaceWithBuildTagInComment interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/filename/iface_darwin.go ================================================ package filename type IfaceWithBuildTagInFilename interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/filename/iface_freebsd.go ================================================ package filename type IfaceWithBuildTagInFilename interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/filename/iface_linux.go ================================================ package filename type IfaceWithBuildTagInFilename interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/buildtag/filename/iface_windows.go ================================================ package filename type IfaceWithBuildTagInFilename interface { Sprintf(format string, a ...interface{}) string } ================================================ FILE: internal/fixtures/constraint_ifaces/constraint_interfaces.go ================================================ package skipconstraintifaces import "golang.org/x/exp/constraints" type Skip1 constraints.Ordered type Skip2 interface { ~int } type Skip3 interface { constraints.Float } type Skip4 interface { constraints.Float | constraints.Integer } type Skip5 Skip1 type Skip6 interface { Skip5 } ================================================ FILE: internal/fixtures/constraint_ifaces/constraint_interfaces_test.go ================================================ package skipconstraintifaces import ( "testing" "github.com/stretchr/testify/require" "github.com/vektra/mockery/v3/internal/file" ) func TestSkipConstraintInterfaces(t *testing.T) { exists, err := file.Exists("./mocks_testify_skipconstraintifaces_test") require.NoError(t, err) require.False(t, exists) } ================================================ FILE: internal/fixtures/constraints/constraints.go ================================================ package constraints type Signed interface { ~int } type Integer interface { ~int } type String interface { ~string } ================================================ FILE: internal/fixtures/consul.go ================================================ package test type ConsulLock interface { Lock(<-chan struct{}) (<-chan struct{}, error) Unlock() error } ================================================ FILE: internal/fixtures/custom_error.go ================================================ package test type Err struct { msg string code uint64 } func (e *Err) Error() string { return e.msg } func (e *Err) Code() uint64 { return e.code } type KeyManager interface { GetKey(string, uint16) ([]byte, *Err) } ================================================ FILE: internal/fixtures/directive_comments/directive_comments.go ================================================ package directive_comments import "net/http" // Requester is an interface that defines a method for making HTTP requests. // //mockery:generate: true type Requester interface { Get(path string) (string, error) } type RequesterWithoutAnnotation interface { Get(path string) (string, error) } // MatryerRequester is an interface that should be mocked with matryer's template // //mockery:generate: true //mockery:template: matryer type MatryerRequester interface { Get(path string) (string, error) } // Server is an interface that defines a method for handling HTTP requests. // //mockery:generate: true //mockery:structname: FunServer type Server interface { HandleRequest(path string, handler http.Handler) } // ServerWithDifferentFile is an interface that defines a method for handling HTTP requests. // //mockery:generate: true //mockery:filename: server_with_different_file.go type ServerWithDifferentFile interface { HandleRequest(path string, handler http.Handler) } //mockery:generate: false type InterfaceWithGenerateFalse interface { DoSomething() } // Interfaces without `generate: true` directive should still be generated // if the interface would have otherwise been included and there are other // mockery configs present in the doc comment. // //mockery:structname: InterfaceWithoutGenerateFoo type InterfaceWithoutGenerate interface { Foo() } ================================================ FILE: internal/fixtures/directive_comments/directive_comments_test.go ================================================ package directive_comments import ( "os" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestInterfaceAnnotations(t *testing.T) { matryerMockBytes, err := os.ReadFile("mocks_matryer_directive_comments_test.go") require.NoError(t, err) testifyMockBytes, err := os.ReadFile("mocks_testify_directive_comments_test.go") require.NoError(t, err) customFileBytes, err := os.ReadFile("server_with_different_file.go") require.NoError(t, err) matryerMock := string(matryerMockBytes) testifyMock := string(testifyMockBytes) customFile := string(customFileBytes) assert.NotContains(t, matryerMock, "type MockRequester struct") assert.Contains(t, testifyMock, "type MockRequester struct") assert.NotContains(t, customFile, "type MockRequester struct") assert.NotContains(t, matryerMock, "type RequesterWithoutAnnotation struct") assert.NotContains(t, testifyMock, "type RequesterWithoutAnnotation struct") assert.NotContains(t, customFile, "type RequesterWithoutAnnotation struct") assert.Contains(t, matryerMock, "type TheMatryerRequester struct") assert.NotContains(t, testifyMock, "type TheMatryerRequester struct") assert.NotContains(t, customFile, "type TheMatryerRequester struct") assert.NotContains(t, matryerMock, "type FunServer struct") assert.Contains(t, testifyMock, "type FunServer struct") assert.NotContains(t, customFile, "type FunServer struct") assert.NotContains(t, matryerMock, "type FunServerWithDifferentFile struct") assert.NotContains(t, testifyMock, "type FunServerWithDifferentFile struct") assert.Contains(t, customFile, "type FunServerWithDifferentFile struct") assert.NotContains(t, matryerMock, "type AnotherFunServerWithDifferentFile struct") assert.NotContains(t, testifyMock, "type AnotherFunServerWithDifferentFile struct") assert.Contains(t, customFile, "type AnotherFunServerWithDifferentFile struct") assert.NotContains(t, testifyMock, "MockInterfaceWithGenerateFalse") assert.Contains(t, testifyMock, "InterfaceWithoutGenerateFoo") } ================================================ FILE: internal/fixtures/directive_comments/mocks_matryer_directive_comments_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer package directive_comments import ( "sync" ) // Ensure that TheMatryerRequester does implement MatryerRequester. // If this is not the case, regenerate this file with mockery. var _ MatryerRequester = &TheMatryerRequester{} // TheMatryerRequester is a mock implementation of MatryerRequester. // // func TestSomethingThatUsesMatryerRequester(t *testing.T) { // // // make and configure a mocked MatryerRequester // mockedMatryerRequester := &TheMatryerRequester{ // GetFunc: func(path string) (string, error) { // panic("mock out the Get method") // }, // } // // // use mockedMatryerRequester in code that requires MatryerRequester // // and then make assertions. // // } type TheMatryerRequester struct { // GetFunc mocks the Get method. GetFunc func(path string) (string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *TheMatryerRequester) Get(path string) (string, error) { if mock.GetFunc == nil { panic("TheMatryerRequester.GetFunc: method is nil but MatryerRequester.Get was just called") } callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedMatryerRequester.GetCalls()) func (mock *TheMatryerRequester) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } ================================================ FILE: internal/fixtures/directive_comments/mocks_testify_directive_comments_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package directive_comments import ( "net/http" mock "github.com/stretchr/testify/mock" ) // NewMockRequester creates a new instance of MockRequester. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequester(t interface { mock.TestingT Cleanup(func()) }) *MockRequester { mock := &MockRequester{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequester is an autogenerated mock type for the Requester type type MockRequester struct { mock.Mock } type MockRequester_Expecter struct { mock *mock.Mock } func (_m *MockRequester) EXPECT() *MockRequester_Expecter { return &MockRequester_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequester func (_mock *MockRequester) Get(path string) (string, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) string); ok { r0 = returnFunc(path) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockRequester_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequester_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequester_Expecter) Get(path interface{}) *MockRequester_Get_Call { return &MockRequester_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequester_Get_Call) Run(run func(path string)) *MockRequester_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequester_Get_Call) Return(s string, err error) *MockRequester_Get_Call { _c.Call.Return(s, err) return _c } func (_c *MockRequester_Get_Call) RunAndReturn(run func(path string) (string, error)) *MockRequester_Get_Call { _c.Call.Return(run) return _c } // NewFunServer creates a new instance of FunServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFunServer(t interface { mock.TestingT Cleanup(func()) }) *FunServer { mock := &FunServer{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // FunServer is an autogenerated mock type for the Server type type FunServer struct { mock.Mock } type FunServer_Expecter struct { mock *mock.Mock } func (_m *FunServer) EXPECT() *FunServer_Expecter { return &FunServer_Expecter{mock: &_m.Mock} } // HandleRequest provides a mock function for the type FunServer func (_mock *FunServer) HandleRequest(path string, handler http.Handler) { _mock.Called(path, handler) return } // FunServer_HandleRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleRequest' type FunServer_HandleRequest_Call struct { *mock.Call } // HandleRequest is a helper method to define mock.On call // - path string // - handler http.Handler func (_e *FunServer_Expecter) HandleRequest(path interface{}, handler interface{}) *FunServer_HandleRequest_Call { return &FunServer_HandleRequest_Call{Call: _e.mock.On("HandleRequest", path, handler)} } func (_c *FunServer_HandleRequest_Call) Run(run func(path string, handler http.Handler)) *FunServer_HandleRequest_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 http.Handler if args[1] != nil { arg1 = args[1].(http.Handler) } run( arg0, arg1, ) }) return _c } func (_c *FunServer_HandleRequest_Call) Return() *FunServer_HandleRequest_Call { _c.Call.Return() return _c } func (_c *FunServer_HandleRequest_Call) RunAndReturn(run func(path string, handler http.Handler)) *FunServer_HandleRequest_Call { _c.Run(run) return _c } // NewInterfaceWithoutGenerateFoo creates a new instance of InterfaceWithoutGenerateFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewInterfaceWithoutGenerateFoo(t interface { mock.TestingT Cleanup(func()) }) *InterfaceWithoutGenerateFoo { mock := &InterfaceWithoutGenerateFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // InterfaceWithoutGenerateFoo is an autogenerated mock type for the InterfaceWithoutGenerate type type InterfaceWithoutGenerateFoo struct { mock.Mock } type InterfaceWithoutGenerateFoo_Expecter struct { mock *mock.Mock } func (_m *InterfaceWithoutGenerateFoo) EXPECT() *InterfaceWithoutGenerateFoo_Expecter { return &InterfaceWithoutGenerateFoo_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type InterfaceWithoutGenerateFoo func (_mock *InterfaceWithoutGenerateFoo) Foo() { _mock.Called() return } // InterfaceWithoutGenerateFoo_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type InterfaceWithoutGenerateFoo_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call func (_e *InterfaceWithoutGenerateFoo_Expecter) Foo() *InterfaceWithoutGenerateFoo_Foo_Call { return &InterfaceWithoutGenerateFoo_Foo_Call{Call: _e.mock.On("Foo")} } func (_c *InterfaceWithoutGenerateFoo_Foo_Call) Run(run func()) *InterfaceWithoutGenerateFoo_Foo_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *InterfaceWithoutGenerateFoo_Foo_Call) Return() *InterfaceWithoutGenerateFoo_Foo_Call { _c.Call.Return() return _c } func (_c *InterfaceWithoutGenerateFoo_Foo_Call) RunAndReturn(run func()) *InterfaceWithoutGenerateFoo_Foo_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/directive_comments/server_with_different_file.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package directive_comments import ( "net/http" mock "github.com/stretchr/testify/mock" ) // NewFunServerWithDifferentFile creates a new instance of FunServerWithDifferentFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFunServerWithDifferentFile(t interface { mock.TestingT Cleanup(func()) }) *FunServerWithDifferentFile { mock := &FunServerWithDifferentFile{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // FunServerWithDifferentFile is an autogenerated mock type for the ServerWithDifferentFile type type FunServerWithDifferentFile struct { mock.Mock } type FunServerWithDifferentFile_Expecter struct { mock *mock.Mock } func (_m *FunServerWithDifferentFile) EXPECT() *FunServerWithDifferentFile_Expecter { return &FunServerWithDifferentFile_Expecter{mock: &_m.Mock} } // HandleRequest provides a mock function for the type FunServerWithDifferentFile func (_mock *FunServerWithDifferentFile) HandleRequest(path string, handler http.Handler) { _mock.Called(path, handler) return } // FunServerWithDifferentFile_HandleRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleRequest' type FunServerWithDifferentFile_HandleRequest_Call struct { *mock.Call } // HandleRequest is a helper method to define mock.On call // - path string // - handler http.Handler func (_e *FunServerWithDifferentFile_Expecter) HandleRequest(path interface{}, handler interface{}) *FunServerWithDifferentFile_HandleRequest_Call { return &FunServerWithDifferentFile_HandleRequest_Call{Call: _e.mock.On("HandleRequest", path, handler)} } func (_c *FunServerWithDifferentFile_HandleRequest_Call) Run(run func(path string, handler http.Handler)) *FunServerWithDifferentFile_HandleRequest_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 http.Handler if args[1] != nil { arg1 = args[1].(http.Handler) } run( arg0, arg1, ) }) return _c } func (_c *FunServerWithDifferentFile_HandleRequest_Call) Return() *FunServerWithDifferentFile_HandleRequest_Call { _c.Call.Return() return _c } func (_c *FunServerWithDifferentFile_HandleRequest_Call) RunAndReturn(run func(path string, handler http.Handler)) *FunServerWithDifferentFile_HandleRequest_Call { _c.Run(run) return _c } // NewAnotherFunServerWithDifferentFile creates a new instance of AnotherFunServerWithDifferentFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewAnotherFunServerWithDifferentFile(t interface { mock.TestingT Cleanup(func()) }) *AnotherFunServerWithDifferentFile { mock := &AnotherFunServerWithDifferentFile{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // AnotherFunServerWithDifferentFile is an autogenerated mock type for the ServerWithDifferentFile type type AnotherFunServerWithDifferentFile struct { mock.Mock } type AnotherFunServerWithDifferentFile_Expecter struct { mock *mock.Mock } func (_m *AnotherFunServerWithDifferentFile) EXPECT() *AnotherFunServerWithDifferentFile_Expecter { return &AnotherFunServerWithDifferentFile_Expecter{mock: &_m.Mock} } // HandleRequest provides a mock function for the type AnotherFunServerWithDifferentFile func (_mock *AnotherFunServerWithDifferentFile) HandleRequest(path string, handler http.Handler) { _mock.Called(path, handler) return } // AnotherFunServerWithDifferentFile_HandleRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleRequest' type AnotherFunServerWithDifferentFile_HandleRequest_Call struct { *mock.Call } // HandleRequest is a helper method to define mock.On call // - path string // - handler http.Handler func (_e *AnotherFunServerWithDifferentFile_Expecter) HandleRequest(path interface{}, handler interface{}) *AnotherFunServerWithDifferentFile_HandleRequest_Call { return &AnotherFunServerWithDifferentFile_HandleRequest_Call{Call: _e.mock.On("HandleRequest", path, handler)} } func (_c *AnotherFunServerWithDifferentFile_HandleRequest_Call) Run(run func(path string, handler http.Handler)) *AnotherFunServerWithDifferentFile_HandleRequest_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 http.Handler if args[1] != nil { arg1 = args[1].(http.Handler) } run( arg0, arg1, ) }) return _c } func (_c *AnotherFunServerWithDifferentFile_HandleRequest_Call) Return() *AnotherFunServerWithDifferentFile_HandleRequest_Call { _c.Call.Return() return _c } func (_c *AnotherFunServerWithDifferentFile_HandleRequest_Call) RunAndReturn(run func(path string, handler http.Handler)) *AnotherFunServerWithDifferentFile_HandleRequest_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/directive_comments_example/interface.go ================================================ package directivecommentsexample // Requester is an interface that defines a method for making HTTP requests. // //mockery:generate: true type Requester interface { Get(path string) (string, error) } type Interface1 interface { Get(path string) (string, error) } ================================================ FILE: internal/fixtures/empty_interface.go ================================================ package test type Blank interface { Create(x interface{}) error } ================================================ FILE: internal/fixtures/empty_return/interface.go ================================================ package empty_return type EmptyReturn interface { NoArgs() WithArgs(a int, b string) } ================================================ FILE: internal/fixtures/empty_return/interface_test.go ================================================ package empty_return import ( "testing" "github.com/stretchr/testify/require" ) func Test(t *testing.T) { m := NewMockEmptyReturn(t) var target EmptyReturn = m t.Run("NoArgs", func(t *testing.T) { run := false m.EXPECT().NoArgs().RunAndReturn(func() { run = true }) target.NoArgs() require.True(t, run) }) t.Run("WithArgs", func(t *testing.T) { run := false m.EXPECT().WithArgs(42, "foo").RunAndReturn(func(arg0 int, arg1 string) { run = true require.Equal(t, 42, arg0) require.Equal(t, "foo", arg1) }) target.WithArgs(42, "foo") require.True(t, run) }) } func TestMatryerNoReturnStub(t *testing.T) { m := &StubMatyerEmptyReturn{} // If this is a stub, this should not panic. m.NoArgs() } ================================================ FILE: internal/fixtures/empty_return/mocks_matryer_empty_return_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer package empty_return import ( "sync" ) // Ensure that StubMatyerEmptyReturn does implement EmptyReturn. // If this is not the case, regenerate this file with mockery. var _ EmptyReturn = &StubMatyerEmptyReturn{} // StubMatyerEmptyReturn is a mock implementation of EmptyReturn. // // func TestSomethingThatUsesEmptyReturn(t *testing.T) { // // // make and configure a mocked EmptyReturn // mockedEmptyReturn := &StubMatyerEmptyReturn{ // NoArgsFunc: func() { // panic("mock out the NoArgs method") // }, // WithArgsFunc: func(a int, b string) { // panic("mock out the WithArgs method") // }, // } // // // use mockedEmptyReturn in code that requires EmptyReturn // // and then make assertions. // // } type StubMatyerEmptyReturn struct { // NoArgsFunc mocks the NoArgs method. NoArgsFunc func() // WithArgsFunc mocks the WithArgs method. WithArgsFunc func(a int, b string) // calls tracks calls to the methods. calls struct { // NoArgs holds details about calls to the NoArgs method. NoArgs []struct { } // WithArgs holds details about calls to the WithArgs method. WithArgs []struct { // A is the a argument value. A int // B is the b argument value. B string } } lockNoArgs sync.RWMutex lockWithArgs sync.RWMutex } // NoArgs calls NoArgsFunc. func (mock *StubMatyerEmptyReturn) NoArgs() { callInfo := struct { }{} mock.lockNoArgs.Lock() mock.calls.NoArgs = append(mock.calls.NoArgs, callInfo) mock.lockNoArgs.Unlock() if mock.NoArgsFunc == nil { return } mock.NoArgsFunc() } // NoArgsCalls gets all the calls that were made to NoArgs. // Check the length with: // // len(mockedEmptyReturn.NoArgsCalls()) func (mock *StubMatyerEmptyReturn) NoArgsCalls() []struct { } { var calls []struct { } mock.lockNoArgs.RLock() calls = mock.calls.NoArgs mock.lockNoArgs.RUnlock() return calls } // ResetNoArgsCalls reset all the calls that were made to NoArgs. func (mock *StubMatyerEmptyReturn) ResetNoArgsCalls() { mock.lockNoArgs.Lock() mock.calls.NoArgs = nil mock.lockNoArgs.Unlock() } // WithArgs calls WithArgsFunc. func (mock *StubMatyerEmptyReturn) WithArgs(a int, b string) { callInfo := struct { A int B string }{ A: a, B: b, } mock.lockWithArgs.Lock() mock.calls.WithArgs = append(mock.calls.WithArgs, callInfo) mock.lockWithArgs.Unlock() if mock.WithArgsFunc == nil { return } mock.WithArgsFunc(a, b) } // WithArgsCalls gets all the calls that were made to WithArgs. // Check the length with: // // len(mockedEmptyReturn.WithArgsCalls()) func (mock *StubMatyerEmptyReturn) WithArgsCalls() []struct { A int B string } { var calls []struct { A int B string } mock.lockWithArgs.RLock() calls = mock.calls.WithArgs mock.lockWithArgs.RUnlock() return calls } // ResetWithArgsCalls reset all the calls that were made to WithArgs. func (mock *StubMatyerEmptyReturn) ResetWithArgsCalls() { mock.lockWithArgs.Lock() mock.calls.WithArgs = nil mock.lockWithArgs.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *StubMatyerEmptyReturn) ResetCalls() { mock.lockNoArgs.Lock() mock.calls.NoArgs = nil mock.lockNoArgs.Unlock() mock.lockWithArgs.Lock() mock.calls.WithArgs = nil mock.lockWithArgs.Unlock() } ================================================ FILE: internal/fixtures/empty_return/mocks_testify_empty_return_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package empty_return import ( mock "github.com/stretchr/testify/mock" ) // NewMockEmptyReturn creates a new instance of MockEmptyReturn. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockEmptyReturn(t interface { mock.TestingT Cleanup(func()) }) *MockEmptyReturn { mock := &MockEmptyReturn{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockEmptyReturn is an autogenerated mock type for the EmptyReturn type type MockEmptyReturn struct { mock.Mock } type MockEmptyReturn_Expecter struct { mock *mock.Mock } func (_m *MockEmptyReturn) EXPECT() *MockEmptyReturn_Expecter { return &MockEmptyReturn_Expecter{mock: &_m.Mock} } // NoArgs provides a mock function for the type MockEmptyReturn func (_mock *MockEmptyReturn) NoArgs() { _mock.Called() return } // MockEmptyReturn_NoArgs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NoArgs' type MockEmptyReturn_NoArgs_Call struct { *mock.Call } // NoArgs is a helper method to define mock.On call func (_e *MockEmptyReturn_Expecter) NoArgs() *MockEmptyReturn_NoArgs_Call { return &MockEmptyReturn_NoArgs_Call{Call: _e.mock.On("NoArgs")} } func (_c *MockEmptyReturn_NoArgs_Call) Run(run func()) *MockEmptyReturn_NoArgs_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockEmptyReturn_NoArgs_Call) Return() *MockEmptyReturn_NoArgs_Call { _c.Call.Return() return _c } func (_c *MockEmptyReturn_NoArgs_Call) RunAndReturn(run func()) *MockEmptyReturn_NoArgs_Call { _c.Run(run) return _c } // WithArgs provides a mock function for the type MockEmptyReturn func (_mock *MockEmptyReturn) WithArgs(a int, b string) { _mock.Called(a, b) return } // MockEmptyReturn_WithArgs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithArgs' type MockEmptyReturn_WithArgs_Call struct { *mock.Call } // WithArgs is a helper method to define mock.On call // - a int // - b string func (_e *MockEmptyReturn_Expecter) WithArgs(a interface{}, b interface{}) *MockEmptyReturn_WithArgs_Call { return &MockEmptyReturn_WithArgs_Call{Call: _e.mock.On("WithArgs", a, b)} } func (_c *MockEmptyReturn_WithArgs_Call) Run(run func(a int, b string)) *MockEmptyReturn_WithArgs_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int if args[0] != nil { arg0 = args[0].(int) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *MockEmptyReturn_WithArgs_Call) Return() *MockEmptyReturn_WithArgs_Call { _c.Call.Return() return _c } func (_c *MockEmptyReturn_WithArgs_Call) RunAndReturn(run func(a int, b string)) *MockEmptyReturn_WithArgs_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/example_project/bar/foo/client.go ================================================ package foo type Client interface { Search(query string) ([]string, error) } ================================================ FILE: internal/fixtures/example_project/baz/foo.go ================================================ package baz import ( ifoo "github.com/vektra/mockery/v3/internal/fixtures/example_project/baz/internal/foo" ) type Baz = ifoo.InternalBaz type Foo interface { DoFoo() string GetBaz() (*Baz, error) } ================================================ FILE: internal/fixtures/example_project/baz/internal/foo/foo.go ================================================ package foo type InternalBaz struct { One string Two int } ================================================ FILE: internal/fixtures/example_project/context/context.go ================================================ package context import ( "context" ) type CollideWithStdLib interface { NewClient(ctx context.Context) } ================================================ FILE: internal/fixtures/example_project/foo/foo.go ================================================ package foo type Baz struct { One string Two int } type Foo interface { DoFoo() string GetBaz() (*Baz, error) } ================================================ FILE: internal/fixtures/example_project/foo/pkg_name_same_as_import.go ================================================ package foo import "github.com/vektra/mockery/v3/internal/fixtures/example_project/bar/foo" type PackageNameSameAsImport interface { NewClient() foo.Client } ================================================ FILE: internal/fixtures/example_project/mocks_testify_example_project_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package example_project import ( mock "github.com/stretchr/testify/mock" "github.com/vektra/mockery/v3/internal/fixtures/example_project/foo" ) // NewMockRoot creates a new instance of MockRoot. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRoot(t interface { mock.TestingT Cleanup(func()) }) *MockRoot { mock := &MockRoot{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRoot is an autogenerated mock type for the Root type type MockRoot struct { mock.Mock } type MockRoot_Expecter struct { mock *mock.Mock } func (_m *MockRoot) EXPECT() *MockRoot_Expecter { return &MockRoot_Expecter{mock: &_m.Mock} } // ReturnsFoo provides a mock function for the type MockRoot func (_mock *MockRoot) ReturnsFoo() (foo.Foo, error) { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ReturnsFoo") } var r0 foo.Foo var r1 error if returnFunc, ok := ret.Get(0).(func() (foo.Foo, error)); ok { return returnFunc() } if returnFunc, ok := ret.Get(0).(func() foo.Foo); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(foo.Foo) } } if returnFunc, ok := ret.Get(1).(func() error); ok { r1 = returnFunc() } else { r1 = ret.Error(1) } return r0, r1 } // MockRoot_ReturnsFoo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReturnsFoo' type MockRoot_ReturnsFoo_Call struct { *mock.Call } // ReturnsFoo is a helper method to define mock.On call func (_e *MockRoot_Expecter) ReturnsFoo() *MockRoot_ReturnsFoo_Call { return &MockRoot_ReturnsFoo_Call{Call: _e.mock.On("ReturnsFoo")} } func (_c *MockRoot_ReturnsFoo_Call) Run(run func()) *MockRoot_ReturnsFoo_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockRoot_ReturnsFoo_Call) Return(foo1 foo.Foo, err error) *MockRoot_ReturnsFoo_Call { _c.Call.Return(foo1, err) return _c } func (_c *MockRoot_ReturnsFoo_Call) RunAndReturn(run func() (foo.Foo, error)) *MockRoot_ReturnsFoo_Call { _c.Call.Return(run) return _c } // TakesBaz provides a mock function for the type MockRoot func (_mock *MockRoot) TakesBaz(baz *foo.Baz) { _mock.Called(baz) return } // MockRoot_TakesBaz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TakesBaz' type MockRoot_TakesBaz_Call struct { *mock.Call } // TakesBaz is a helper method to define mock.On call // - baz *foo.Baz func (_e *MockRoot_Expecter) TakesBaz(baz interface{}) *MockRoot_TakesBaz_Call { return &MockRoot_TakesBaz_Call{Call: _e.mock.On("TakesBaz", baz)} } func (_c *MockRoot_TakesBaz_Call) Run(run func(baz *foo.Baz)) *MockRoot_TakesBaz_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 *foo.Baz if args[0] != nil { arg0 = args[0].(*foo.Baz) } run( arg0, ) }) return _c } func (_c *MockRoot_TakesBaz_Call) Return() *MockRoot_TakesBaz_Call { _c.Call.Return() return _c } func (_c *MockRoot_TakesBaz_Call) RunAndReturn(run func(baz *foo.Baz)) *MockRoot_TakesBaz_Call { _c.Run(run) return _c } // NewMockStringer creates a new instance of MockStringer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockStringer(t interface { mock.TestingT Cleanup(func()) }) *MockStringer { mock := &MockStringer{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockStringer is an autogenerated mock type for the Stringer type type MockStringer struct { mock.Mock } type MockStringer_Expecter struct { mock *mock.Mock } func (_m *MockStringer) EXPECT() *MockStringer_Expecter { return &MockStringer_Expecter{mock: &_m.Mock} } // String provides a mock function for the type MockStringer func (_mock *MockStringer) String() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for String") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockStringer_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' type MockStringer_String_Call struct { *mock.Call } // String is a helper method to define mock.On call func (_e *MockStringer_Expecter) String() *MockStringer_String_Call { return &MockStringer_String_Call{Call: _e.mock.On("String")} } func (_c *MockStringer_String_Call) Run(run func()) *MockStringer_String_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockStringer_String_Call) Return(s string) *MockStringer_String_Call { _c.Call.Return(s) return _c } func (_c *MockStringer_String_Call) RunAndReturn(run func() string) *MockStringer_String_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/example_project/pkg_with_submodules/go.mod ================================================ module github.com/vektra/mockery/v3/pkg/fixtures/example_project/pkg_with_submodules go 1.19 ================================================ FILE: internal/fixtures/example_project/pkg_with_submodules/string.go ================================================ package pkg_with_submodules type Stringer interface { String() string } ================================================ FILE: internal/fixtures/example_project/pkg_with_submodules/submodule/go.mod ================================================ module github.com/vektra/mockery/v3/pkg/fixtures/example_project/submodule go 1.21.0 ================================================ FILE: internal/fixtures/example_project/pkg_with_submodules/submodule/string.go ================================================ package submodule type Stringer interface { String() string } ================================================ FILE: internal/fixtures/example_project/pkg_with_submodules/subpkg/string.go ================================================ package subpkg type Stringer interface { String() string } ================================================ FILE: internal/fixtures/example_project/pkg_with_submodules/subpkg/submodule/go.mod ================================================ module github.com/vektra/mockery/v3/pkg/fixtures/example_project/pkg_with_submodules/subpkg/submodule go 1.19 ================================================ FILE: internal/fixtures/example_project/pkg_with_submodules/subpkg/submodule/string.go ================================================ package submodule type Stringer interface { String() string } ================================================ FILE: internal/fixtures/example_project/pkg_with_subpkgs/foo.go ================================================ package pkg_with_subpkgs ================================================ FILE: internal/fixtures/example_project/pkg_with_subpkgs/subpkg1/foo.go ================================================ package subpkg1 ================================================ FILE: internal/fixtures/example_project/pkg_with_subpkgs/subpkg2/foo.go ================================================ package subpkg2 ================================================ FILE: internal/fixtures/example_project/pkg_with_subpkgs/subpkg2/subpkg3/foo.go ================================================ package subpkg3 type Getter interface { Get(string) string } ================================================ FILE: internal/fixtures/example_project/replace_type/README.md ================================================ ## Fix replace-type for different packages from the same source [Issue 710](https://github.com/vektra/mockery/pull/710) This package is used to test the case where multiple types come from the same package (`replace_type/rti/internal`), but results in types in different packages (`replace_type/rt1` and `replace_type/rt2`). Tests `TestReplaceTypePackageMultiplePrologue` and `TestReplaceTypePackageMultiple` use it to check if this outputs the correct import and type names. ================================================ FILE: internal/fixtures/example_project/replace_type/mocks_testify_replace_type_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package replace_type import ( mock "github.com/stretchr/testify/mock" "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt1" "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt2" ) // NewMockRType creates a new instance of MockRType. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRType(t interface { mock.TestingT Cleanup(func()) }) *MockRType { mock := &MockRType{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRType is an autogenerated mock type for the RType type type MockRType struct { mock.Mock } type MockRType_Expecter struct { mock *mock.Mock } func (_m *MockRType) EXPECT() *MockRType_Expecter { return &MockRType_Expecter{mock: &_m.Mock} } // Replace1 provides a mock function for the type MockRType func (_mock *MockRType) Replace1(f rt1.RType1) { _mock.Called(f) return } // MockRType_Replace1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Replace1' type MockRType_Replace1_Call struct { *mock.Call } // Replace1 is a helper method to define mock.On call // - f rt1.RType1 func (_e *MockRType_Expecter) Replace1(f interface{}) *MockRType_Replace1_Call { return &MockRType_Replace1_Call{Call: _e.mock.On("Replace1", f)} } func (_c *MockRType_Replace1_Call) Run(run func(f rt1.RType1)) *MockRType_Replace1_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 rt1.RType1 if args[0] != nil { arg0 = args[0].(rt1.RType1) } run( arg0, ) }) return _c } func (_c *MockRType_Replace1_Call) Return() *MockRType_Replace1_Call { _c.Call.Return() return _c } func (_c *MockRType_Replace1_Call) RunAndReturn(run func(f rt1.RType1)) *MockRType_Replace1_Call { _c.Run(run) return _c } // Replace2 provides a mock function for the type MockRType func (_mock *MockRType) Replace2(f rt2.RType2) { _mock.Called(f) return } // MockRType_Replace2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Replace2' type MockRType_Replace2_Call struct { *mock.Call } // Replace2 is a helper method to define mock.On call // - f rt2.RType2 func (_e *MockRType_Expecter) Replace2(f interface{}) *MockRType_Replace2_Call { return &MockRType_Replace2_Call{Call: _e.mock.On("Replace2", f)} } func (_c *MockRType_Replace2_Call) Run(run func(f rt2.RType2)) *MockRType_Replace2_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 rt2.RType2 if args[0] != nil { arg0 = args[0].(rt2.RType2) } run( arg0, ) }) return _c } func (_c *MockRType_Replace2_Call) Return() *MockRType_Replace2_Call { _c.Call.Return() return _c } func (_c *MockRType_Replace2_Call) RunAndReturn(run func(f rt2.RType2)) *MockRType_Replace2_Call { _c.Run(run) return _c } // NewRTypeReplaced1 creates a new instance of RTypeReplaced1. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRTypeReplaced1(t interface { mock.TestingT Cleanup(func()) }) *RTypeReplaced1 { mock := &RTypeReplaced1{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // RTypeReplaced1 is an autogenerated mock type for the RType type type RTypeReplaced1 struct { mock.Mock } type RTypeReplaced1_Expecter struct { mock *mock.Mock } func (_m *RTypeReplaced1) EXPECT() *RTypeReplaced1_Expecter { return &RTypeReplaced1_Expecter{mock: &_m.Mock} } // Replace1 provides a mock function for the type RTypeReplaced1 func (_mock *RTypeReplaced1) Replace1(f rt2.RType2) { _mock.Called(f) return } // RTypeReplaced1_Replace1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Replace1' type RTypeReplaced1_Replace1_Call struct { *mock.Call } // Replace1 is a helper method to define mock.On call // - f rt2.RType2 func (_e *RTypeReplaced1_Expecter) Replace1(f interface{}) *RTypeReplaced1_Replace1_Call { return &RTypeReplaced1_Replace1_Call{Call: _e.mock.On("Replace1", f)} } func (_c *RTypeReplaced1_Replace1_Call) Run(run func(f rt2.RType2)) *RTypeReplaced1_Replace1_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 rt2.RType2 if args[0] != nil { arg0 = args[0].(rt2.RType2) } run( arg0, ) }) return _c } func (_c *RTypeReplaced1_Replace1_Call) Return() *RTypeReplaced1_Replace1_Call { _c.Call.Return() return _c } func (_c *RTypeReplaced1_Replace1_Call) RunAndReturn(run func(f rt2.RType2)) *RTypeReplaced1_Replace1_Call { _c.Run(run) return _c } // Replace2 provides a mock function for the type RTypeReplaced1 func (_mock *RTypeReplaced1) Replace2(f rt2.RType2) { _mock.Called(f) return } // RTypeReplaced1_Replace2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Replace2' type RTypeReplaced1_Replace2_Call struct { *mock.Call } // Replace2 is a helper method to define mock.On call // - f rt2.RType2 func (_e *RTypeReplaced1_Expecter) Replace2(f interface{}) *RTypeReplaced1_Replace2_Call { return &RTypeReplaced1_Replace2_Call{Call: _e.mock.On("Replace2", f)} } func (_c *RTypeReplaced1_Replace2_Call) Run(run func(f rt2.RType2)) *RTypeReplaced1_Replace2_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 rt2.RType2 if args[0] != nil { arg0 = args[0].(rt2.RType2) } run( arg0, ) }) return _c } func (_c *RTypeReplaced1_Replace2_Call) Return() *RTypeReplaced1_Replace2_Call { _c.Call.Return() return _c } func (_c *RTypeReplaced1_Replace2_Call) RunAndReturn(run func(f rt2.RType2)) *RTypeReplaced1_Replace2_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/example_project/replace_type/rt.go ================================================ package replace_type import ( "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt1" "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt2" ) type RType interface { Replace1(f rt1.RType1) Replace2(f rt2.RType2) } ================================================ FILE: internal/fixtures/example_project/replace_type/rt_test.go ================================================ package replace_type import ( "os" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestReplaceType(t *testing.T) { mockFile := "./mocks_testify_replace_type_test.go" b, err := os.ReadFile(mockFile) require.NoError(t, err) // .mockery.yml replaced github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt1 // with github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/rt2 assert.True(t, strings.Contains(string(b), "*RTypeReplaced1) Replace1(f rt2.RType2) {")) // This should contain no replaced type. assert.True(t, strings.Contains(string(b), "*MockRType) Replace1(f rt1.RType1) {")) } ================================================ FILE: internal/fixtures/example_project/replace_type/rti/internal/rti.go ================================================ package internal type RTInternal1 struct { A int } type RTInternal2 struct { B string } ================================================ FILE: internal/fixtures/example_project/replace_type/rti/rt1/rt1.go ================================================ package rt1 import "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/internal" type RType1 = internal.RTInternal1 ================================================ FILE: internal/fixtures/example_project/replace_type/rti/rt2/rt2.go ================================================ package rt2 import "github.com/vektra/mockery/v3/internal/fixtures/example_project/replace_type/rti/internal" type RType2 = internal.RTInternal2 ================================================ FILE: internal/fixtures/example_project/root.go ================================================ package example_project import "github.com/vektra/mockery/v3/internal/fixtures/example_project/foo" type Root interface { TakesBaz(*foo.Baz) ReturnsFoo() (foo.Foo, error) } ================================================ FILE: internal/fixtures/example_project/string.go ================================================ package example_project type Stringer interface { String() string } ================================================ FILE: internal/fixtures/example_project/string_test.go ================================================ package example_project import ( "testing" "github.com/stretchr/testify/assert" ) func Foo(s Stringer) string { return s.String() } func TestString(t *testing.T) { mockStringer := NewMockStringer(t) mockStringer.EXPECT().String().Return("mockery") assert.Equal(t, "mockery", Foo(mockStringer)) } ================================================ FILE: internal/fixtures/expecter.go ================================================ package test type Expecter interface { NoArg() string NoReturn(str string) ManyArgsReturns(str string, i int) (strs []string, err error) Variadic(ints ...int) error VariadicMany(i int, a string, intfs ...interface{}) error } type VariadicNoReturnInterface interface { VariadicNoReturn(j int, is ...interface{}) } ================================================ FILE: internal/fixtures/expecter_test.go ================================================ package test import ( "errors" "reflect" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) var ( defaultString = "some input string" defaultInt = 1 defaultError = errors.New("some error") ) // Test that the generated code for ExpecterTest interface is usable func TestExpecter(t *testing.T) { expMock := MockExpecter{} t.Run("NoArg", func(t *testing.T) { var runCalled bool expMock.EXPECT().NoArg().Run(func() { runCalled = true }).Return(defaultString).Once() // Good call str := expMock.NoArg() require.Equal(t, defaultString, str) require.True(t, runCalled) // Call again panic assert.Panics(t, func() { expMock.NoArg() }) expMock.AssertExpectations(t) }) t.Run("NoReturn", func(t *testing.T) { var runCalled bool expMock.EXPECT().NoReturn(mock.Anything).Run(func(s string) { require.Equal(t, defaultString, s) runCalled = true }).Return().Once() // Good call expMock.NoReturn(defaultString) require.True(t, runCalled) // Call again panic require.Panics(t, func() { expMock.NoReturn(defaultString) }) expMock.AssertExpectations(t) }) t.Run("ManyArgsReturns", func(t *testing.T) { var runCalled bool expMock.EXPECT().ManyArgsReturns(mock.Anything, defaultInt).Run(func(s string, i int) { require.Equal(t, defaultString, s) require.Equal(t, defaultInt, i) runCalled = true }).Return([]string{defaultString, defaultString}, defaultError).Once() // Call with wrong arg require.Panics(t, func() { _, _ = expMock.ManyArgsReturns(defaultString, 0) }) // Good call strs, err := expMock.ManyArgsReturns(defaultString, defaultInt) require.Equal(t, []string{defaultString, defaultString}, strs) require.Equal(t, defaultError, err) require.True(t, runCalled) // Call again panic require.Panics(t, func() { _, _ = expMock.ManyArgsReturns(defaultString, defaultInt) }) expMock.AssertExpectations(t) }) t.Run("Variadic", func(t *testing.T) { runCalled := 0 expMock.EXPECT().Variadic(1).Run(func(ints ...int) { require.Equal(t, []int{1}, ints) runCalled++ }).Return(defaultError).Once() expMock.EXPECT().Variadic(1, 2, 3).Run(func(ints ...int) { require.Equal(t, []int{1, 2, 3}, ints) runCalled++ }).Return(nil).Once() expMock.EXPECT().Variadic(1, mock.Anything, 3, mock.Anything).Run(func(ints ...int) { require.Equal(t, []int{1, 2, 3, 4}, ints) runCalled++ }).Return(nil).Once() expMock.EXPECT().Variadic([]interface{}{2, 3, mock.Anything}...).Run(func(ints ...int) { require.Equal(t, []int{2, 3, 4}, ints) runCalled++ }).Return(nil).Once() args := []int{1, 2, 3, 4, 5} expMock.EXPECT().Variadic(intfSlice(args)...).Run(func(ints ...int) { require.Equal(t, args, ints) runCalled++ }).Return(nil).Once() require.Error(t, expMock.Variadic(1)) require.NoError(t, expMock.Variadic(1, 2, 3)) require.NoError(t, expMock.Variadic(1, 2, 3, 4)) require.NoError(t, expMock.Variadic(2, 3, 4)) require.NoError(t, expMock.Variadic(args...)) require.Equal(t, 5, runCalled) expMock.AssertExpectations(t) }) t.Run("VariadicOtherArgs", func(t *testing.T) { runCalled := 0 expMock.EXPECT().VariadicMany(defaultInt, defaultString).Return(defaultError). Run(func(i int, a string, intfs ...interface{}) { require.Equal(t, defaultInt, i) require.Equal(t, defaultString, a) require.Empty(t, intfs) runCalled++ }).Once() require.Error(t, expMock.VariadicMany(defaultInt, defaultString)) expMock.EXPECT().VariadicMany(defaultInt, defaultString, 1).Return(defaultError). Run(func(i int, a string, intfs ...interface{}) { require.Equal(t, defaultInt, i) require.Equal(t, defaultString, a) require.Equal(t, []interface{}{1}, intfs) runCalled++ }).Once() require.Error(t, expMock.VariadicMany(defaultInt, defaultString, 1)) expMock.EXPECT().VariadicMany(mock.Anything, mock.Anything, 1, nil, mock.AnythingOfType("string")).Return(nil). Run(func(i int, a string, intfs ...interface{}) { require.Equal(t, defaultInt, i) require.Equal(t, defaultString, a) require.Equal(t, []interface{}{1, nil, "blah"}, intfs) runCalled++ }).Once() require.Panics(t, func() { assert.NoError(t, expMock.VariadicMany(defaultInt, defaultString, 1, nil, 123)) }) require.NoError(t, expMock.VariadicMany(defaultInt, defaultString, 1, nil, "blah")) expMock.EXPECT().VariadicMany(mock.Anything, mock.Anything, 1, nil, "blah").Run(func(i int, a string, intfs ...interface{}) { require.Equal(t, defaultInt, i) require.Equal(t, defaultString, a) require.Equal(t, []interface{}{1, nil, "blah"}, intfs) runCalled++ }).Return(defaultError).Once() require.Panics(t, func() { assert.NoError(t, expMock.VariadicMany(defaultInt, defaultString, 1, nil, "other string")) }) err := expMock.VariadicMany(defaultInt, defaultString, 1, nil, "blah") require.Equal(t, defaultError, err) args := []interface{}{1, 2, 3, 4, 5} expMock.EXPECT().VariadicMany(defaultInt, defaultString, args...).Run(func(i int, a string, intfs ...interface{}) { require.Equal(t, defaultInt, i) require.Equal(t, defaultString, a) require.Equal(t, []interface{}{1, 2, 3, 4, 5}, intfs) runCalled++ }).Return(nil).Once() require.NoError(t, expMock.VariadicMany(defaultInt, defaultString, args...)) require.Equal(t, 5, runCalled) expMock.AssertExpectations(t) }) } func intfSlice(slice interface{}) []interface{} { val := reflect.ValueOf(slice) switch val.Kind() { case reflect.Slice, reflect.Array, reflect.String: out := make([]interface{}, val.Len()) for i := 0; i < val.Len(); i++ { out[i] = val.Index(i).Interface() } return out default: panic("inftSlice only accepts slices or arrays") } } ================================================ FILE: internal/fixtures/func_args_collision.go ================================================ package test type FuncArgsCollision interface { Foo(ret interface{}) error } ================================================ FILE: internal/fixtures/function.go ================================================ package test import ( "context" ) type SendFunc func(ctx context.Context, data string) (int, error) ================================================ FILE: internal/fixtures/generic.go ================================================ package test import ( "io" "github.com/vektra/mockery/v3/internal/fixtures/constraints" ) type RequesterGenerics[ TAny any, TComparable comparable, TSigned constraints.Signed, // external constraint TIntf GetInt, // internal interface TExternalIntf io.Writer, // external interface TGenIntf GetGeneric[TSigned], // generic interface TInlineType interface{ ~int | ~uint }, // inlined interface constraints TInlineTypeGeneric interface { ~int | GenericType[int, GetInt] comparable }, // inlined type constraints ] interface { GenericArguments(TAny, TComparable) (TSigned, TIntf) GenericStructs(GenericType[TAny, TIntf]) GenericType[TSigned, TIntf] GenericAnonymousStructs(struct{ Type1 TExternalIntf }) struct { Type2 GenericType[string, EmbeddedGet[int]] } } type GenericType[T any, S GetInt] struct { Any T Some []S } type GetInt interface{ Get() int } type GetGeneric[T constraints.Integer] interface{ Get() T } type EmbeddedGet[T constraints.Signed] interface{ GetGeneric[T] } type ReplaceGeneric[ TImport any, TConstraint constraints.Signed, TKeep any, ] interface { A(t1 TImport) TKeep B() TImport C() TConstraint } type ReplaceGenericSelf[T any] interface { A() T } ================================================ FILE: internal/fixtures/http/http.go ================================================ package http type MyStruct struct{} ================================================ FILE: internal/fixtures/iface_new_type/iface_new_type_test.go ================================================ package iface_new_type import ( "testing" ) func TestUsage(t *testing.T) { interface1 := NewMockInterface1(t) interface1.EXPECT().Method1().Return() interface1.Method1() } ================================================ FILE: internal/fixtures/iface_new_type/interface.go ================================================ package iface_new_type import "github.com/vektra/mockery/v3/internal/fixtures/iface_new_type/subpkg" type Interface1 interface { Method1() } type ( Interface2 Interface1 Interface3 subpkg.SubPkgInterface ) ================================================ FILE: internal/fixtures/iface_new_type/mocks_testify_iface_new_type_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package iface_new_type import ( mock "github.com/stretchr/testify/mock" ) // NewMockInterface1 creates a new instance of MockInterface1. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockInterface1(t interface { mock.TestingT Cleanup(func()) }) *MockInterface1 { mock := &MockInterface1{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockInterface1 is an autogenerated mock type for the Interface1 type type MockInterface1 struct { mock.Mock } type MockInterface1_Expecter struct { mock *mock.Mock } func (_m *MockInterface1) EXPECT() *MockInterface1_Expecter { return &MockInterface1_Expecter{mock: &_m.Mock} } // Method1 provides a mock function for the type MockInterface1 func (_mock *MockInterface1) Method1() { _mock.Called() return } // MockInterface1_Method1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Method1' type MockInterface1_Method1_Call struct { *mock.Call } // Method1 is a helper method to define mock.On call func (_e *MockInterface1_Expecter) Method1() *MockInterface1_Method1_Call { return &MockInterface1_Method1_Call{Call: _e.mock.On("Method1")} } func (_c *MockInterface1_Method1_Call) Run(run func()) *MockInterface1_Method1_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockInterface1_Method1_Call) Return() *MockInterface1_Method1_Call { _c.Call.Return() return _c } func (_c *MockInterface1_Method1_Call) RunAndReturn(run func()) *MockInterface1_Method1_Call { _c.Run(run) return _c } // NewMockInterface2 creates a new instance of MockInterface2. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockInterface2(t interface { mock.TestingT Cleanup(func()) }) *MockInterface2 { mock := &MockInterface2{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockInterface2 is an autogenerated mock type for the Interface2 type type MockInterface2 struct { mock.Mock } type MockInterface2_Expecter struct { mock *mock.Mock } func (_m *MockInterface2) EXPECT() *MockInterface2_Expecter { return &MockInterface2_Expecter{mock: &_m.Mock} } // Method1 provides a mock function for the type MockInterface2 func (_mock *MockInterface2) Method1() { _mock.Called() return } // MockInterface2_Method1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Method1' type MockInterface2_Method1_Call struct { *mock.Call } // Method1 is a helper method to define mock.On call func (_e *MockInterface2_Expecter) Method1() *MockInterface2_Method1_Call { return &MockInterface2_Method1_Call{Call: _e.mock.On("Method1")} } func (_c *MockInterface2_Method1_Call) Run(run func()) *MockInterface2_Method1_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockInterface2_Method1_Call) Return() *MockInterface2_Method1_Call { _c.Call.Return() return _c } func (_c *MockInterface2_Method1_Call) RunAndReturn(run func()) *MockInterface2_Method1_Call { _c.Run(run) return _c } // NewMockInterface3 creates a new instance of MockInterface3. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockInterface3(t interface { mock.TestingT Cleanup(func()) }) *MockInterface3 { mock := &MockInterface3{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockInterface3 is an autogenerated mock type for the Interface3 type type MockInterface3 struct { mock.Mock } type MockInterface3_Expecter struct { mock *mock.Mock } func (_m *MockInterface3) EXPECT() *MockInterface3_Expecter { return &MockInterface3_Expecter{mock: &_m.Mock} } // Method1 provides a mock function for the type MockInterface3 func (_mock *MockInterface3) Method1() { _mock.Called() return } // MockInterface3_Method1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Method1' type MockInterface3_Method1_Call struct { *mock.Call } // Method1 is a helper method to define mock.On call func (_e *MockInterface3_Expecter) Method1() *MockInterface3_Method1_Call { return &MockInterface3_Method1_Call{Call: _e.mock.On("Method1")} } func (_c *MockInterface3_Method1_Call) Run(run func()) *MockInterface3_Method1_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockInterface3_Method1_Call) Return() *MockInterface3_Method1_Call { _c.Call.Return() return _c } func (_c *MockInterface3_Method1_Call) RunAndReturn(run func()) *MockInterface3_Method1_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/iface_new_type/subpkg/interface.go ================================================ package subpkg type SubPkgInterface interface { Method1() } ================================================ FILE: internal/fixtures/iface_typed_param/getter_iface_typed_param.go ================================================ package iface_typed_param import "io" type GetterIfaceTypedParam[T io.Reader] interface { Get() T } ================================================ FILE: internal/fixtures/iface_typed_param/main_test.go ================================================ package iface_typed_param import ( "bufio" "net/http" "testing" "github.com/stretchr/testify/assert" ) func TestIfaceWithIfaceTypedParamReturnValues(t *testing.T) { t.Parallel() tests := []struct { name string returnVal *bufio.Reader }{ {"nil return val", nil}, {"returning val", bufio.NewReader(http.NoBody)}, } for _, test := range tests { t.Run(test.name, func(st *testing.T) { m := NewMockGetterIfaceTypedParam[*bufio.Reader](st) m.EXPECT().Get().Return(test.returnVal) assert.Equal(st, test.returnVal, m.Get()) }) } } ================================================ FILE: internal/fixtures/iface_typed_param/mocks_testify_iface_typed_param_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package iface_typed_param import ( "io" mock "github.com/stretchr/testify/mock" ) // NewMockGetterIfaceTypedParam creates a new instance of MockGetterIfaceTypedParam. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockGetterIfaceTypedParam[T io.Reader](t interface { mock.TestingT Cleanup(func()) }) *MockGetterIfaceTypedParam[T] { mock := &MockGetterIfaceTypedParam[T]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockGetterIfaceTypedParam is an autogenerated mock type for the GetterIfaceTypedParam type type MockGetterIfaceTypedParam[T io.Reader] struct { mock.Mock } type MockGetterIfaceTypedParam_Expecter[T io.Reader] struct { mock *mock.Mock } func (_m *MockGetterIfaceTypedParam[T]) EXPECT() *MockGetterIfaceTypedParam_Expecter[T] { return &MockGetterIfaceTypedParam_Expecter[T]{mock: &_m.Mock} } // Get provides a mock function for the type MockGetterIfaceTypedParam func (_mock *MockGetterIfaceTypedParam[T]) Get() T { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 T if returnFunc, ok := ret.Get(0).(func() T); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(T) } } return r0 } // MockGetterIfaceTypedParam_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockGetterIfaceTypedParam_Get_Call[T io.Reader] struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockGetterIfaceTypedParam_Expecter[T]) Get() *MockGetterIfaceTypedParam_Get_Call[T] { return &MockGetterIfaceTypedParam_Get_Call[T]{Call: _e.mock.On("Get")} } func (_c *MockGetterIfaceTypedParam_Get_Call[T]) Run(run func()) *MockGetterIfaceTypedParam_Get_Call[T] { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockGetterIfaceTypedParam_Get_Call[T]) Return(v T) *MockGetterIfaceTypedParam_Get_Call[T] { _c.Call.Return(v) return _c } func (_c *MockGetterIfaceTypedParam_Get_Call[T]) RunAndReturn(run func() T) *MockGetterIfaceTypedParam_Get_Call[T] { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/iface_typed_param_lowercase/getter_iface_typed_param.go ================================================ package iface_typed_param_lowercase type GetterIfaceTypedParam[a comparable] interface { Get(a) a } ================================================ FILE: internal/fixtures/iface_typed_param_lowercase/main_test.go ================================================ package iface_typed_param_lowercase import ( "testing" "github.com/stretchr/testify/assert" ) func TestIfaceWithIfaceTypedParamLowerCaseReturnValues(t *testing.T) { t.Parallel() tests := []struct { name string arg *int returnVal *int }{ {"nil return val", nil, nil}, {"returning val", toPtr(2), toPtr(2)}, } for _, test := range tests { t.Run(test.name, func(st *testing.T) { m := NewMockGetterIfaceTypedParam[*int](st) m.EXPECT().Get(test.arg).Return(test.returnVal) assert.Equal(st, test.returnVal, m.Get(test.arg)) }) } } func toPtr(i int) *int { return &i } ================================================ FILE: internal/fixtures/iface_typed_param_lowercase/mocks_testify_iface_typed_param_lowercase_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package iface_typed_param_lowercase import ( mock "github.com/stretchr/testify/mock" ) // NewMockGetterIfaceTypedParam creates a new instance of MockGetterIfaceTypedParam. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockGetterIfaceTypedParam[a comparable](t interface { mock.TestingT Cleanup(func()) }) *MockGetterIfaceTypedParam[a] { mock := &MockGetterIfaceTypedParam[a]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockGetterIfaceTypedParam is an autogenerated mock type for the GetterIfaceTypedParam type type MockGetterIfaceTypedParam[a comparable] struct { mock.Mock } type MockGetterIfaceTypedParam_Expecter[a comparable] struct { mock *mock.Mock } func (_m *MockGetterIfaceTypedParam[a]) EXPECT() *MockGetterIfaceTypedParam_Expecter[a] { return &MockGetterIfaceTypedParam_Expecter[a]{mock: &_m.Mock} } // Get provides a mock function for the type MockGetterIfaceTypedParam func (_mock *MockGetterIfaceTypedParam[a]) Get(v a) a { ret := _mock.Called(v) if len(ret) == 0 { panic("no return value specified for Get") } var r0 a if returnFunc, ok := ret.Get(0).(func(a) a); ok { r0 = returnFunc(v) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(a) } } return r0 } // MockGetterIfaceTypedParam_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockGetterIfaceTypedParam_Get_Call[a comparable] struct { *mock.Call } // Get is a helper method to define mock.On call // - v a func (_e *MockGetterIfaceTypedParam_Expecter[a]) Get(v interface{}) *MockGetterIfaceTypedParam_Get_Call[a] { return &MockGetterIfaceTypedParam_Get_Call[a]{Call: _e.mock.On("Get", v)} } func (_c *MockGetterIfaceTypedParam_Get_Call[a]) Run(run func(v a)) *MockGetterIfaceTypedParam_Get_Call[a] { _c.Call.Run(func(args mock.Arguments) { var arg0 a if args[0] != nil { arg0 = args[0].(a) } run( arg0, ) }) return _c } func (_c *MockGetterIfaceTypedParam_Get_Call[a]) Return(v1 a) *MockGetterIfaceTypedParam_Get_Call[a] { _c.Call.Return(v1) return _c } func (_c *MockGetterIfaceTypedParam_Get_Call[a]) RunAndReturn(run func(v a) a) *MockGetterIfaceTypedParam_Get_Call[a] { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/imports_from_nested_interface.go ================================================ package test import ( "github.com/vektra/mockery/v3/internal/fixtures/http" ) type HasConflictingNestedImports interface { RequesterNS Z() http.MyStruct } ================================================ FILE: internal/fixtures/imports_same_as_package.go ================================================ package test import ( test "github.com/vektra/mockery/v3/internal/fixtures/redefined_type_b" ) type C int type ImportsSameAsPackage interface { A() test.B B() KeyManager C(C) } ================================================ FILE: internal/fixtures/include_auto_generated/interface.go ================================================ // Code generated by random code generator; DO NOT EDIT. package includeautogenerated type Foo interface { Bar() string } ================================================ FILE: internal/fixtures/include_auto_generated/interface_test.go ================================================ package includeautogenerated import ( "testing" "github.com/stretchr/testify/assert" ) func TestIncludeAutoGenerated(t *testing.T) { m := NewMockFoo(t) m.EXPECT().Bar().Return("foo") assert.Equal(t, "foo", m.Bar()) } ================================================ FILE: internal/fixtures/include_auto_generated/mocks_testify_includeautogenerated_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package includeautogenerated import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockFoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *MockFoo_Expecter) Bar() *MockFoo_Bar_Call { return &MockFoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *MockFoo_Bar_Call) Run(run func()) *MockFoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Bar_Call) Return(s string) *MockFoo_Bar_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Bar_Call) RunAndReturn(run func() string) *MockFoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/index_list_expr/index_list_expression.go ================================================ package index_list_expr type GenericMultipleTypes[T1 any, T2 any, T3 any] interface { Func(arg1 *T1, arg2 T2) T3 } type IndexListExpr GenericMultipleTypes[int, string, bool] ================================================ FILE: internal/fixtures/index_list_expr/index_list_expression_test.go ================================================ package index_list_expr import ( "testing" "github.com/stretchr/testify/require" ) func TestUsage(t *testing.T) { gmt := NewMockGenericMultipleTypes[string, int, bool](t) testString := "foo" gmt.EXPECT().Func(&testString, 1).Return(false) require.Equal(t, false, gmt.Func(&testString, 1)) ile := NewMockIndexListExpr(t) testInt := 1 ile.EXPECT().Func(&testInt, "foo").Return(true) require.Equal(t, true, ile.Func(&testInt, "foo")) } ================================================ FILE: internal/fixtures/index_list_expr/mocks_testify_index_list_expr_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package index_list_expr import ( mock "github.com/stretchr/testify/mock" ) // NewMockGenericMultipleTypes creates a new instance of MockGenericMultipleTypes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockGenericMultipleTypes[T1 any, T2 any, T3 any](t interface { mock.TestingT Cleanup(func()) }) *MockGenericMultipleTypes[T1, T2, T3] { mock := &MockGenericMultipleTypes[T1, T2, T3]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockGenericMultipleTypes is an autogenerated mock type for the GenericMultipleTypes type type MockGenericMultipleTypes[T1 any, T2 any, T3 any] struct { mock.Mock } type MockGenericMultipleTypes_Expecter[T1 any, T2 any, T3 any] struct { mock *mock.Mock } func (_m *MockGenericMultipleTypes[T1, T2, T3]) EXPECT() *MockGenericMultipleTypes_Expecter[T1, T2, T3] { return &MockGenericMultipleTypes_Expecter[T1, T2, T3]{mock: &_m.Mock} } // Func provides a mock function for the type MockGenericMultipleTypes func (_mock *MockGenericMultipleTypes[T1, T2, T3]) Func(arg1 *T1, arg2 T2) T3 { ret := _mock.Called(arg1, arg2) if len(ret) == 0 { panic("no return value specified for Func") } var r0 T3 if returnFunc, ok := ret.Get(0).(func(*T1, T2) T3); ok { r0 = returnFunc(arg1, arg2) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(T3) } } return r0 } // MockGenericMultipleTypes_Func_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Func' type MockGenericMultipleTypes_Func_Call[T1 any, T2 any, T3 any] struct { *mock.Call } // Func is a helper method to define mock.On call // - arg1 *T1 // - arg2 T2 func (_e *MockGenericMultipleTypes_Expecter[T1, T2, T3]) Func(arg1 interface{}, arg2 interface{}) *MockGenericMultipleTypes_Func_Call[T1, T2, T3] { return &MockGenericMultipleTypes_Func_Call[T1, T2, T3]{Call: _e.mock.On("Func", arg1, arg2)} } func (_c *MockGenericMultipleTypes_Func_Call[T1, T2, T3]) Run(run func(arg1 *T1, arg2 T2)) *MockGenericMultipleTypes_Func_Call[T1, T2, T3] { _c.Call.Run(func(args mock.Arguments) { var arg0 *T1 if args[0] != nil { arg0 = args[0].(*T1) } var arg1 T2 if args[1] != nil { arg1 = args[1].(T2) } run( arg0, arg1, ) }) return _c } func (_c *MockGenericMultipleTypes_Func_Call[T1, T2, T3]) Return(v T3) *MockGenericMultipleTypes_Func_Call[T1, T2, T3] { _c.Call.Return(v) return _c } func (_c *MockGenericMultipleTypes_Func_Call[T1, T2, T3]) RunAndReturn(run func(arg1 *T1, arg2 T2) T3) *MockGenericMultipleTypes_Func_Call[T1, T2, T3] { _c.Call.Return(run) return _c } // NewMockIndexListExpr creates a new instance of MockIndexListExpr. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockIndexListExpr(t interface { mock.TestingT Cleanup(func()) }) *MockIndexListExpr { mock := &MockIndexListExpr{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockIndexListExpr is an autogenerated mock type for the IndexListExpr type type MockIndexListExpr struct { mock.Mock } type MockIndexListExpr_Expecter struct { mock *mock.Mock } func (_m *MockIndexListExpr) EXPECT() *MockIndexListExpr_Expecter { return &MockIndexListExpr_Expecter{mock: &_m.Mock} } // Func provides a mock function for the type MockIndexListExpr func (_mock *MockIndexListExpr) Func(arg1 *int, arg2 string) bool { ret := _mock.Called(arg1, arg2) if len(ret) == 0 { panic("no return value specified for Func") } var r0 bool if returnFunc, ok := ret.Get(0).(func(*int, string) bool); ok { r0 = returnFunc(arg1, arg2) } else { r0 = ret.Get(0).(bool) } return r0 } // MockIndexListExpr_Func_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Func' type MockIndexListExpr_Func_Call struct { *mock.Call } // Func is a helper method to define mock.On call // - arg1 *int // - arg2 string func (_e *MockIndexListExpr_Expecter) Func(arg1 interface{}, arg2 interface{}) *MockIndexListExpr_Func_Call { return &MockIndexListExpr_Func_Call{Call: _e.mock.On("Func", arg1, arg2)} } func (_c *MockIndexListExpr_Func_Call) Run(run func(arg1 *int, arg2 string)) *MockIndexListExpr_Func_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 *int if args[0] != nil { arg0 = args[0].(*int) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *MockIndexListExpr_Func_Call) Return(b bool) *MockIndexListExpr_Func_Call { _c.Call.Return(b) return _c } func (_c *MockIndexListExpr_Func_Call) RunAndReturn(run func(arg1 *int, arg2 string) bool) *MockIndexListExpr_Func_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/inpackage/interface.go ================================================ package inpackage type InternalStringType string type Foo interface { Bar() InternalStringType } ================================================ FILE: internal/fixtures/inpackage/interface_test.go ================================================ package inpackage import ( "os" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestInPackageOverride(t *testing.T) { mockFile := "./subpkg/mocks_testify_inpackage_test.go" contents, err := os.ReadFile(mockFile) require.NoError(t, err) // The `inpackage` parameter overrides the auto-detection logic // for whether or not a mock is in the original package. Thus, the types // from the original package should be unqualified. Technically, the // generated mock file in this case will be invalid code because // it uses the unqualified InternalStringType from outside of the `inpackage` package. // We're just testing that the override logic is working correctly. assert.True(t, strings.Contains(string(contents), "Bar() InternalStringType")) } ================================================ FILE: internal/fixtures/inpackage/subpkg/mocks_testify_inpackage_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify //go:build nobuild package inpackage import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() InternalStringType { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 InternalStringType if returnFunc, ok := ret.Get(0).(func() InternalStringType); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(InternalStringType) } return r0 } // MockFoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockFoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *MockFoo_Expecter) Bar() *MockFoo_Bar_Call { return &MockFoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *MockFoo_Bar_Call) Run(run func()) *MockFoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Bar_Call) Return(internalStringType InternalStringType) *MockFoo_Bar_Call { _c.Call.Return(internalStringType) return _c } func (_c *MockFoo_Bar_Call) RunAndReturn(run func() InternalStringType) *MockFoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/instantiated_generic_interface.go ================================================ package test type GenericInterface[M any] interface { Func(arg *M) int } type InstantiatedGenericInterface GenericInterface[float32] ================================================ FILE: internal/fixtures/instantiated_generic_struct.go ================================================ package test // Tests that mockery does not try to generate mocks for a struct type. type InstantiatedStruct GenericStruct[int] type GenericStruct[T any] struct { Attribute []T } ================================================ FILE: internal/fixtures/interface_dir_relative/interface.go ================================================ package interfacedirrelative type Foo interface { Bar() string } ================================================ FILE: internal/fixtures/interface_dir_relative/interface_test.go ================================================ package interfacedirrelative import ( "testing" mocks "github.com/vektra/mockery/v3/internal/fixtures/interface_dir_relative/internal/fixtures/interface_dir_relative" ) func TestFoo(t *testing.T) { m := mocks.NewMockFoo(t) m.EXPECT().Bar().Return("foo") if m.Bar() != "foo" { t.Errorf("expected foo but got %s", m.Bar()) } } ================================================ FILE: internal/fixtures/interface_dir_relative/internal/fixtures/interface_dir_relative/mocks.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package interfacedirrelative import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockFoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *MockFoo_Expecter) Bar() *MockFoo_Bar_Call { return &MockFoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *MockFoo_Bar_Call) Run(run func()) *MockFoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Bar_Call) Return(s string) *MockFoo_Bar_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Bar_Call) RunAndReturn(run func() string) *MockFoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/interface_dir_relative/mocks/fixtures/interface_dir_relative/mocks.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package interfacedirrelative import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockFoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *MockFoo_Expecter) Bar() *MockFoo_Bar_Call { return &MockFoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *MockFoo_Bar_Call) Run(run func()) *MockFoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Bar_Call) Return(s string) *MockFoo_Bar_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Bar_Call) RunAndReturn(run func() string) *MockFoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/io_import.go ================================================ package test import "io" type MyReader interface { io.Reader } ================================================ FILE: internal/fixtures/issue_766.go ================================================ package test type Issue766 interface { FetchData( fetchFunc func(x ...int) ([]int, error), ) ([]int, error) } ================================================ FILE: internal/fixtures/issue_766_test.go ================================================ package test import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) // Asserts it implements the interface var _ Issue766 = new(MockIssue766) func TestIssue766(t *testing.T) { fetchFunc := func(i ...int) ([]int, error) { ret := make([]int, 0, len(i)) for idx := 0; idx < len(i); idx++ { ret[idx] = i[idx] + 1 } return ret, nil } expected := []int{1, 2, 3} mockFetchData := NewMockIssue766(t) mockFetchData. EXPECT(). FetchData(mock.AnythingOfType("func(...int) ([]int, error)")). Return([]int{1, 2, 3}, nil) actual, err := mockFetchData.FetchData(fetchFunc) assert.NoError(t, err) assert.Equal(t, expected, actual) } ================================================ FILE: internal/fixtures/map_to_interface.go ================================================ package test type MapToInterface interface { Foo(arg1 ...map[string]interface{}) } ================================================ FILE: internal/fixtures/method_args/same_name_arg_and_type/entity.go ================================================ package same_name_arg_and_type type ( interfaceA interface { // SomeMethod - contains args with the same names of the type and arg DoB(interfaceB interfaceB) interfaceB DoB0(interfaceB interfaceB0) interfaceB0 DoB0v2(interfaceB0 interfaceB0) interfaceB0 } interfaceB interface { GetData() int } interfaceB0 interface { DoB0(interfaceB0 interfaceB0) interfaceB0 } ) ================================================ FILE: internal/fixtures/method_args/same_name_arg_and_type/entity_test.go ================================================ package same_name_arg_and_type import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) type testStruct struct { interfaceA interfaceA } func (s *testStruct) ExecDoB() interfaceB { var in interfaceB = nil return s.interfaceA.DoB(in) } func (s *testStruct) ExecDoB0() interfaceB0 { var in interfaceB0 = nil return s.interfaceA.DoB0(in) } func (s *testStruct) ExecDoB0v2() interfaceB0 { var in interfaceB0 = nil return s.interfaceA.DoB0v2(in) } func Test(t *testing.T) { t.Run("ExecDoB", func(t *testing.T) { mockInterfaceB := newMockinterfaceB(t) mockInterfaceA := newMockinterfaceA(t) mockInterfaceA.On("DoB", mock.Anything).Return(mockInterfaceB) s := testStruct{ interfaceA: mockInterfaceA, } res := s.ExecDoB() assert.Equal(t, mockInterfaceB, res) }) t.Run("ExecDoB0", func(t *testing.T) { mockInterfaceB0 := newMockinterfaceB0(t) mockInterfaceA := newMockinterfaceA(t) mockInterfaceA.On("DoB0", mock.Anything).Return(mockInterfaceB0) s := testStruct{ interfaceA: mockInterfaceA, } res := s.ExecDoB0() assert.Equal(t, mockInterfaceB0, res) }) t.Run("ExecDoB0v2", func(t *testing.T) { mockInterfaceB0 := newMockinterfaceB0(t) mockInterfaceA := newMockinterfaceA(t) mockInterfaceA.On("DoB0v2", mock.Anything).Return(mockInterfaceB0) s := testStruct{ interfaceA: mockInterfaceA, } res := s.ExecDoB0v2() assert.Equal(t, mockInterfaceB0, res) }) } ================================================ FILE: internal/fixtures/method_args/same_name_arg_and_type/mocks_testify_same_name_arg_and_type_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package same_name_arg_and_type import ( mock "github.com/stretchr/testify/mock" ) // newMockinterfaceA creates a new instance of mockinterfaceA. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockinterfaceA(t interface { mock.TestingT Cleanup(func()) }) *mockinterfaceA { mock := &mockinterfaceA{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // mockinterfaceA is an autogenerated mock type for the interfaceA type type mockinterfaceA struct { mock.Mock } type mockinterfaceA_Expecter struct { mock *mock.Mock } func (_m *mockinterfaceA) EXPECT() *mockinterfaceA_Expecter { return &mockinterfaceA_Expecter{mock: &_m.Mock} } // DoB provides a mock function for the type mockinterfaceA func (_mock *mockinterfaceA) DoB(interfaceB1 interfaceB) interfaceB { ret := _mock.Called(interfaceB1) if len(ret) == 0 { panic("no return value specified for DoB") } var r0 interfaceB if returnFunc, ok := ret.Get(0).(func(interfaceB) interfaceB); ok { r0 = returnFunc(interfaceB1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(interfaceB) } } return r0 } // mockinterfaceA_DoB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoB' type mockinterfaceA_DoB_Call struct { *mock.Call } // DoB is a helper method to define mock.On call // - interfaceB1 interfaceB func (_e *mockinterfaceA_Expecter) DoB(interfaceB1 interface{}) *mockinterfaceA_DoB_Call { return &mockinterfaceA_DoB_Call{Call: _e.mock.On("DoB", interfaceB1)} } func (_c *mockinterfaceA_DoB_Call) Run(run func(interfaceB1 interfaceB)) *mockinterfaceA_DoB_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 interfaceB if args[0] != nil { arg0 = args[0].(interfaceB) } run( arg0, ) }) return _c } func (_c *mockinterfaceA_DoB_Call) Return(interfaceBMoqParam interfaceB) *mockinterfaceA_DoB_Call { _c.Call.Return(interfaceBMoqParam) return _c } func (_c *mockinterfaceA_DoB_Call) RunAndReturn(run func(interfaceB1 interfaceB) interfaceB) *mockinterfaceA_DoB_Call { _c.Call.Return(run) return _c } // DoB0 provides a mock function for the type mockinterfaceA func (_mock *mockinterfaceA) DoB0(interfaceB interfaceB0) interfaceB0 { ret := _mock.Called(interfaceB) if len(ret) == 0 { panic("no return value specified for DoB0") } var r0 interfaceB0 if returnFunc, ok := ret.Get(0).(func(interfaceB0) interfaceB0); ok { r0 = returnFunc(interfaceB) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(interfaceB0) } } return r0 } // mockinterfaceA_DoB0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoB0' type mockinterfaceA_DoB0_Call struct { *mock.Call } // DoB0 is a helper method to define mock.On call // - interfaceB interfaceB0 func (_e *mockinterfaceA_Expecter) DoB0(interfaceB interface{}) *mockinterfaceA_DoB0_Call { return &mockinterfaceA_DoB0_Call{Call: _e.mock.On("DoB0", interfaceB)} } func (_c *mockinterfaceA_DoB0_Call) Run(run func(interfaceB interfaceB0)) *mockinterfaceA_DoB0_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 interfaceB0 if args[0] != nil { arg0 = args[0].(interfaceB0) } run( arg0, ) }) return _c } func (_c *mockinterfaceA_DoB0_Call) Return(interfaceB0MoqParam interfaceB0) *mockinterfaceA_DoB0_Call { _c.Call.Return(interfaceB0MoqParam) return _c } func (_c *mockinterfaceA_DoB0_Call) RunAndReturn(run func(interfaceB interfaceB0) interfaceB0) *mockinterfaceA_DoB0_Call { _c.Call.Return(run) return _c } // DoB0v2 provides a mock function for the type mockinterfaceA func (_mock *mockinterfaceA) DoB0v2(interfaceB01 interfaceB0) interfaceB0 { ret := _mock.Called(interfaceB01) if len(ret) == 0 { panic("no return value specified for DoB0v2") } var r0 interfaceB0 if returnFunc, ok := ret.Get(0).(func(interfaceB0) interfaceB0); ok { r0 = returnFunc(interfaceB01) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(interfaceB0) } } return r0 } // mockinterfaceA_DoB0v2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoB0v2' type mockinterfaceA_DoB0v2_Call struct { *mock.Call } // DoB0v2 is a helper method to define mock.On call // - interfaceB01 interfaceB0 func (_e *mockinterfaceA_Expecter) DoB0v2(interfaceB01 interface{}) *mockinterfaceA_DoB0v2_Call { return &mockinterfaceA_DoB0v2_Call{Call: _e.mock.On("DoB0v2", interfaceB01)} } func (_c *mockinterfaceA_DoB0v2_Call) Run(run func(interfaceB01 interfaceB0)) *mockinterfaceA_DoB0v2_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 interfaceB0 if args[0] != nil { arg0 = args[0].(interfaceB0) } run( arg0, ) }) return _c } func (_c *mockinterfaceA_DoB0v2_Call) Return(interfaceB0MoqParam interfaceB0) *mockinterfaceA_DoB0v2_Call { _c.Call.Return(interfaceB0MoqParam) return _c } func (_c *mockinterfaceA_DoB0v2_Call) RunAndReturn(run func(interfaceB01 interfaceB0) interfaceB0) *mockinterfaceA_DoB0v2_Call { _c.Call.Return(run) return _c } // newMockinterfaceB creates a new instance of mockinterfaceB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockinterfaceB(t interface { mock.TestingT Cleanup(func()) }) *mockinterfaceB { mock := &mockinterfaceB{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // mockinterfaceB is an autogenerated mock type for the interfaceB type type mockinterfaceB struct { mock.Mock } type mockinterfaceB_Expecter struct { mock *mock.Mock } func (_m *mockinterfaceB) EXPECT() *mockinterfaceB_Expecter { return &mockinterfaceB_Expecter{mock: &_m.Mock} } // GetData provides a mock function for the type mockinterfaceB func (_mock *mockinterfaceB) GetData() int { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetData") } var r0 int if returnFunc, ok := ret.Get(0).(func() int); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(int) } return r0 } // mockinterfaceB_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' type mockinterfaceB_GetData_Call struct { *mock.Call } // GetData is a helper method to define mock.On call func (_e *mockinterfaceB_Expecter) GetData() *mockinterfaceB_GetData_Call { return &mockinterfaceB_GetData_Call{Call: _e.mock.On("GetData")} } func (_c *mockinterfaceB_GetData_Call) Run(run func()) *mockinterfaceB_GetData_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *mockinterfaceB_GetData_Call) Return(n int) *mockinterfaceB_GetData_Call { _c.Call.Return(n) return _c } func (_c *mockinterfaceB_GetData_Call) RunAndReturn(run func() int) *mockinterfaceB_GetData_Call { _c.Call.Return(run) return _c } // newMockinterfaceB0 creates a new instance of mockinterfaceB0. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockinterfaceB0(t interface { mock.TestingT Cleanup(func()) }) *mockinterfaceB0 { mock := &mockinterfaceB0{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // mockinterfaceB0 is an autogenerated mock type for the interfaceB0 type type mockinterfaceB0 struct { mock.Mock } type mockinterfaceB0_Expecter struct { mock *mock.Mock } func (_m *mockinterfaceB0) EXPECT() *mockinterfaceB0_Expecter { return &mockinterfaceB0_Expecter{mock: &_m.Mock} } // DoB0 provides a mock function for the type mockinterfaceB0 func (_mock *mockinterfaceB0) DoB0(interfaceB01 interfaceB0) interfaceB0 { ret := _mock.Called(interfaceB01) if len(ret) == 0 { panic("no return value specified for DoB0") } var r0 interfaceB0 if returnFunc, ok := ret.Get(0).(func(interfaceB0) interfaceB0); ok { r0 = returnFunc(interfaceB01) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(interfaceB0) } } return r0 } // mockinterfaceB0_DoB0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoB0' type mockinterfaceB0_DoB0_Call struct { *mock.Call } // DoB0 is a helper method to define mock.On call // - interfaceB01 interfaceB0 func (_e *mockinterfaceB0_Expecter) DoB0(interfaceB01 interface{}) *mockinterfaceB0_DoB0_Call { return &mockinterfaceB0_DoB0_Call{Call: _e.mock.On("DoB0", interfaceB01)} } func (_c *mockinterfaceB0_DoB0_Call) Run(run func(interfaceB01 interfaceB0)) *mockinterfaceB0_DoB0_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 interfaceB0 if args[0] != nil { arg0 = args[0].(interfaceB0) } run( arg0, ) }) return _c } func (_c *mockinterfaceB0_DoB0_Call) Return(interfaceB0MoqParam interfaceB0) *mockinterfaceB0_DoB0_Call { _c.Call.Return(interfaceB0MoqParam) return _c } func (_c *mockinterfaceB0_DoB0_Call) RunAndReturn(run func(interfaceB01 interfaceB0) interfaceB0) *mockinterfaceB0_DoB0_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/mock_method_uses_pkg_iface.go ================================================ package test type Sibling interface { DoSomething() } type UsesOtherPkgIface interface { DoSomethingElse(obj Sibling) } ================================================ FILE: internal/fixtures/mocks_io_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package test import ( "io" mock "github.com/stretchr/testify/mock" ) // NewMockReader creates a new instance of MockReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReader(t interface { mock.TestingT Cleanup(func()) }) *MockReader { mock := &MockReader{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReader is an autogenerated mock type for the Reader type type MockReader struct { mock.Mock } type MockReader_Expecter struct { mock *mock.Mock } func (_m *MockReader) EXPECT() *MockReader_Expecter { return &MockReader_Expecter{mock: &_m.Mock} } // Read provides a mock function for the type MockReader func (_mock *MockReader) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReader_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockReader_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockReader_Expecter) Read(p interface{}) *MockReader_Read_Call { return &MockReader_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockReader_Read_Call) Run(run func(p []byte)) *MockReader_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReader_Read_Call) Return(n int, err error) *MockReader_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockReader_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReader_Read_Call { _c.Call.Return(run) return _c } // NewMockWriter creates a new instance of MockWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockWriter(t interface { mock.TestingT Cleanup(func()) }) *MockWriter { mock := &MockWriter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockWriter is an autogenerated mock type for the Writer type type MockWriter struct { mock.Mock } type MockWriter_Expecter struct { mock *mock.Mock } func (_m *MockWriter) EXPECT() *MockWriter_Expecter { return &MockWriter_Expecter{mock: &_m.Mock} } // Write provides a mock function for the type MockWriter func (_mock *MockWriter) Write(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Write") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockWriter_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' type MockWriter_Write_Call struct { *mock.Call } // Write is a helper method to define mock.On call // - p []byte func (_e *MockWriter_Expecter) Write(p interface{}) *MockWriter_Write_Call { return &MockWriter_Write_Call{Call: _e.mock.On("Write", p)} } func (_c *MockWriter_Write_Call) Run(run func(p []byte)) *MockWriter_Write_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockWriter_Write_Call) Return(n int, err error) *MockWriter_Write_Call { _c.Call.Return(n, err) return _c } func (_c *MockWriter_Write_Call) RunAndReturn(run func(p []byte) (int, error)) *MockWriter_Write_Call { _c.Call.Return(run) return _c } // NewMockCloser creates a new instance of MockCloser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockCloser(t interface { mock.TestingT Cleanup(func()) }) *MockCloser { mock := &MockCloser{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockCloser is an autogenerated mock type for the Closer type type MockCloser struct { mock.Mock } type MockCloser_Expecter struct { mock *mock.Mock } func (_m *MockCloser) EXPECT() *MockCloser_Expecter { return &MockCloser_Expecter{mock: &_m.Mock} } // Close provides a mock function for the type MockCloser func (_mock *MockCloser) Close() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockCloser_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' type MockCloser_Close_Call struct { *mock.Call } // Close is a helper method to define mock.On call func (_e *MockCloser_Expecter) Close() *MockCloser_Close_Call { return &MockCloser_Close_Call{Call: _e.mock.On("Close")} } func (_c *MockCloser_Close_Call) Run(run func()) *MockCloser_Close_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockCloser_Close_Call) Return(err error) *MockCloser_Close_Call { _c.Call.Return(err) return _c } func (_c *MockCloser_Close_Call) RunAndReturn(run func() error) *MockCloser_Close_Call { _c.Call.Return(run) return _c } // NewMockSeeker creates a new instance of MockSeeker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockSeeker(t interface { mock.TestingT Cleanup(func()) }) *MockSeeker { mock := &MockSeeker{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockSeeker is an autogenerated mock type for the Seeker type type MockSeeker struct { mock.Mock } type MockSeeker_Expecter struct { mock *mock.Mock } func (_m *MockSeeker) EXPECT() *MockSeeker_Expecter { return &MockSeeker_Expecter{mock: &_m.Mock} } // Seek provides a mock function for the type MockSeeker func (_mock *MockSeeker) Seek(offset int64, whence int) (int64, error) { ret := _mock.Called(offset, whence) if len(ret) == 0 { panic("no return value specified for Seek") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(int64, int) (int64, error)); ok { return returnFunc(offset, whence) } if returnFunc, ok := ret.Get(0).(func(int64, int) int64); ok { r0 = returnFunc(offset, whence) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(int64, int) error); ok { r1 = returnFunc(offset, whence) } else { r1 = ret.Error(1) } return r0, r1 } // MockSeeker_Seek_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seek' type MockSeeker_Seek_Call struct { *mock.Call } // Seek is a helper method to define mock.On call // - offset int64 // - whence int func (_e *MockSeeker_Expecter) Seek(offset interface{}, whence interface{}) *MockSeeker_Seek_Call { return &MockSeeker_Seek_Call{Call: _e.mock.On("Seek", offset, whence)} } func (_c *MockSeeker_Seek_Call) Run(run func(offset int64, whence int)) *MockSeeker_Seek_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int64 if args[0] != nil { arg0 = args[0].(int64) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockSeeker_Seek_Call) Return(n int64, err error) *MockSeeker_Seek_Call { _c.Call.Return(n, err) return _c } func (_c *MockSeeker_Seek_Call) RunAndReturn(run func(offset int64, whence int) (int64, error)) *MockSeeker_Seek_Call { _c.Call.Return(run) return _c } // NewMockReadWriter creates a new instance of MockReadWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReadWriter(t interface { mock.TestingT Cleanup(func()) }) *MockReadWriter { mock := &MockReadWriter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReadWriter is an autogenerated mock type for the ReadWriter type type MockReadWriter struct { mock.Mock } type MockReadWriter_Expecter struct { mock *mock.Mock } func (_m *MockReadWriter) EXPECT() *MockReadWriter_Expecter { return &MockReadWriter_Expecter{mock: &_m.Mock} } // Read provides a mock function for the type MockReadWriter func (_mock *MockReadWriter) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadWriter_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockReadWriter_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockReadWriter_Expecter) Read(p interface{}) *MockReadWriter_Read_Call { return &MockReadWriter_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockReadWriter_Read_Call) Run(run func(p []byte)) *MockReadWriter_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadWriter_Read_Call) Return(n int, err error) *MockReadWriter_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadWriter_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadWriter_Read_Call { _c.Call.Return(run) return _c } // Write provides a mock function for the type MockReadWriter func (_mock *MockReadWriter) Write(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Write") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadWriter_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' type MockReadWriter_Write_Call struct { *mock.Call } // Write is a helper method to define mock.On call // - p []byte func (_e *MockReadWriter_Expecter) Write(p interface{}) *MockReadWriter_Write_Call { return &MockReadWriter_Write_Call{Call: _e.mock.On("Write", p)} } func (_c *MockReadWriter_Write_Call) Run(run func(p []byte)) *MockReadWriter_Write_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadWriter_Write_Call) Return(n int, err error) *MockReadWriter_Write_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadWriter_Write_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadWriter_Write_Call { _c.Call.Return(run) return _c } // NewMockReadCloser creates a new instance of MockReadCloser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReadCloser(t interface { mock.TestingT Cleanup(func()) }) *MockReadCloser { mock := &MockReadCloser{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReadCloser is an autogenerated mock type for the ReadCloser type type MockReadCloser struct { mock.Mock } type MockReadCloser_Expecter struct { mock *mock.Mock } func (_m *MockReadCloser) EXPECT() *MockReadCloser_Expecter { return &MockReadCloser_Expecter{mock: &_m.Mock} } // Close provides a mock function for the type MockReadCloser func (_mock *MockReadCloser) Close() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockReadCloser_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' type MockReadCloser_Close_Call struct { *mock.Call } // Close is a helper method to define mock.On call func (_e *MockReadCloser_Expecter) Close() *MockReadCloser_Close_Call { return &MockReadCloser_Close_Call{Call: _e.mock.On("Close")} } func (_c *MockReadCloser_Close_Call) Run(run func()) *MockReadCloser_Close_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockReadCloser_Close_Call) Return(err error) *MockReadCloser_Close_Call { _c.Call.Return(err) return _c } func (_c *MockReadCloser_Close_Call) RunAndReturn(run func() error) *MockReadCloser_Close_Call { _c.Call.Return(run) return _c } // Read provides a mock function for the type MockReadCloser func (_mock *MockReadCloser) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadCloser_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockReadCloser_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockReadCloser_Expecter) Read(p interface{}) *MockReadCloser_Read_Call { return &MockReadCloser_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockReadCloser_Read_Call) Run(run func(p []byte)) *MockReadCloser_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadCloser_Read_Call) Return(n int, err error) *MockReadCloser_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadCloser_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadCloser_Read_Call { _c.Call.Return(run) return _c } // NewMockWriteCloser creates a new instance of MockWriteCloser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockWriteCloser(t interface { mock.TestingT Cleanup(func()) }) *MockWriteCloser { mock := &MockWriteCloser{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockWriteCloser is an autogenerated mock type for the WriteCloser type type MockWriteCloser struct { mock.Mock } type MockWriteCloser_Expecter struct { mock *mock.Mock } func (_m *MockWriteCloser) EXPECT() *MockWriteCloser_Expecter { return &MockWriteCloser_Expecter{mock: &_m.Mock} } // Close provides a mock function for the type MockWriteCloser func (_mock *MockWriteCloser) Close() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockWriteCloser_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' type MockWriteCloser_Close_Call struct { *mock.Call } // Close is a helper method to define mock.On call func (_e *MockWriteCloser_Expecter) Close() *MockWriteCloser_Close_Call { return &MockWriteCloser_Close_Call{Call: _e.mock.On("Close")} } func (_c *MockWriteCloser_Close_Call) Run(run func()) *MockWriteCloser_Close_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockWriteCloser_Close_Call) Return(err error) *MockWriteCloser_Close_Call { _c.Call.Return(err) return _c } func (_c *MockWriteCloser_Close_Call) RunAndReturn(run func() error) *MockWriteCloser_Close_Call { _c.Call.Return(run) return _c } // Write provides a mock function for the type MockWriteCloser func (_mock *MockWriteCloser) Write(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Write") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockWriteCloser_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' type MockWriteCloser_Write_Call struct { *mock.Call } // Write is a helper method to define mock.On call // - p []byte func (_e *MockWriteCloser_Expecter) Write(p interface{}) *MockWriteCloser_Write_Call { return &MockWriteCloser_Write_Call{Call: _e.mock.On("Write", p)} } func (_c *MockWriteCloser_Write_Call) Run(run func(p []byte)) *MockWriteCloser_Write_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockWriteCloser_Write_Call) Return(n int, err error) *MockWriteCloser_Write_Call { _c.Call.Return(n, err) return _c } func (_c *MockWriteCloser_Write_Call) RunAndReturn(run func(p []byte) (int, error)) *MockWriteCloser_Write_Call { _c.Call.Return(run) return _c } // NewMockReadWriteCloser creates a new instance of MockReadWriteCloser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReadWriteCloser(t interface { mock.TestingT Cleanup(func()) }) *MockReadWriteCloser { mock := &MockReadWriteCloser{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReadWriteCloser is an autogenerated mock type for the ReadWriteCloser type type MockReadWriteCloser struct { mock.Mock } type MockReadWriteCloser_Expecter struct { mock *mock.Mock } func (_m *MockReadWriteCloser) EXPECT() *MockReadWriteCloser_Expecter { return &MockReadWriteCloser_Expecter{mock: &_m.Mock} } // Close provides a mock function for the type MockReadWriteCloser func (_mock *MockReadWriteCloser) Close() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockReadWriteCloser_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' type MockReadWriteCloser_Close_Call struct { *mock.Call } // Close is a helper method to define mock.On call func (_e *MockReadWriteCloser_Expecter) Close() *MockReadWriteCloser_Close_Call { return &MockReadWriteCloser_Close_Call{Call: _e.mock.On("Close")} } func (_c *MockReadWriteCloser_Close_Call) Run(run func()) *MockReadWriteCloser_Close_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockReadWriteCloser_Close_Call) Return(err error) *MockReadWriteCloser_Close_Call { _c.Call.Return(err) return _c } func (_c *MockReadWriteCloser_Close_Call) RunAndReturn(run func() error) *MockReadWriteCloser_Close_Call { _c.Call.Return(run) return _c } // Read provides a mock function for the type MockReadWriteCloser func (_mock *MockReadWriteCloser) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadWriteCloser_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockReadWriteCloser_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockReadWriteCloser_Expecter) Read(p interface{}) *MockReadWriteCloser_Read_Call { return &MockReadWriteCloser_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockReadWriteCloser_Read_Call) Run(run func(p []byte)) *MockReadWriteCloser_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadWriteCloser_Read_Call) Return(n int, err error) *MockReadWriteCloser_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadWriteCloser_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadWriteCloser_Read_Call { _c.Call.Return(run) return _c } // Write provides a mock function for the type MockReadWriteCloser func (_mock *MockReadWriteCloser) Write(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Write") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadWriteCloser_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' type MockReadWriteCloser_Write_Call struct { *mock.Call } // Write is a helper method to define mock.On call // - p []byte func (_e *MockReadWriteCloser_Expecter) Write(p interface{}) *MockReadWriteCloser_Write_Call { return &MockReadWriteCloser_Write_Call{Call: _e.mock.On("Write", p)} } func (_c *MockReadWriteCloser_Write_Call) Run(run func(p []byte)) *MockReadWriteCloser_Write_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadWriteCloser_Write_Call) Return(n int, err error) *MockReadWriteCloser_Write_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadWriteCloser_Write_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadWriteCloser_Write_Call { _c.Call.Return(run) return _c } // NewMockReadSeeker creates a new instance of MockReadSeeker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReadSeeker(t interface { mock.TestingT Cleanup(func()) }) *MockReadSeeker { mock := &MockReadSeeker{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReadSeeker is an autogenerated mock type for the ReadSeeker type type MockReadSeeker struct { mock.Mock } type MockReadSeeker_Expecter struct { mock *mock.Mock } func (_m *MockReadSeeker) EXPECT() *MockReadSeeker_Expecter { return &MockReadSeeker_Expecter{mock: &_m.Mock} } // Read provides a mock function for the type MockReadSeeker func (_mock *MockReadSeeker) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadSeeker_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockReadSeeker_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockReadSeeker_Expecter) Read(p interface{}) *MockReadSeeker_Read_Call { return &MockReadSeeker_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockReadSeeker_Read_Call) Run(run func(p []byte)) *MockReadSeeker_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadSeeker_Read_Call) Return(n int, err error) *MockReadSeeker_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadSeeker_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadSeeker_Read_Call { _c.Call.Return(run) return _c } // Seek provides a mock function for the type MockReadSeeker func (_mock *MockReadSeeker) Seek(offset int64, whence int) (int64, error) { ret := _mock.Called(offset, whence) if len(ret) == 0 { panic("no return value specified for Seek") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(int64, int) (int64, error)); ok { return returnFunc(offset, whence) } if returnFunc, ok := ret.Get(0).(func(int64, int) int64); ok { r0 = returnFunc(offset, whence) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(int64, int) error); ok { r1 = returnFunc(offset, whence) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadSeeker_Seek_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seek' type MockReadSeeker_Seek_Call struct { *mock.Call } // Seek is a helper method to define mock.On call // - offset int64 // - whence int func (_e *MockReadSeeker_Expecter) Seek(offset interface{}, whence interface{}) *MockReadSeeker_Seek_Call { return &MockReadSeeker_Seek_Call{Call: _e.mock.On("Seek", offset, whence)} } func (_c *MockReadSeeker_Seek_Call) Run(run func(offset int64, whence int)) *MockReadSeeker_Seek_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int64 if args[0] != nil { arg0 = args[0].(int64) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockReadSeeker_Seek_Call) Return(n int64, err error) *MockReadSeeker_Seek_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadSeeker_Seek_Call) RunAndReturn(run func(offset int64, whence int) (int64, error)) *MockReadSeeker_Seek_Call { _c.Call.Return(run) return _c } // NewMockReadSeekCloser creates a new instance of MockReadSeekCloser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReadSeekCloser(t interface { mock.TestingT Cleanup(func()) }) *MockReadSeekCloser { mock := &MockReadSeekCloser{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReadSeekCloser is an autogenerated mock type for the ReadSeekCloser type type MockReadSeekCloser struct { mock.Mock } type MockReadSeekCloser_Expecter struct { mock *mock.Mock } func (_m *MockReadSeekCloser) EXPECT() *MockReadSeekCloser_Expecter { return &MockReadSeekCloser_Expecter{mock: &_m.Mock} } // Close provides a mock function for the type MockReadSeekCloser func (_mock *MockReadSeekCloser) Close() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockReadSeekCloser_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' type MockReadSeekCloser_Close_Call struct { *mock.Call } // Close is a helper method to define mock.On call func (_e *MockReadSeekCloser_Expecter) Close() *MockReadSeekCloser_Close_Call { return &MockReadSeekCloser_Close_Call{Call: _e.mock.On("Close")} } func (_c *MockReadSeekCloser_Close_Call) Run(run func()) *MockReadSeekCloser_Close_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockReadSeekCloser_Close_Call) Return(err error) *MockReadSeekCloser_Close_Call { _c.Call.Return(err) return _c } func (_c *MockReadSeekCloser_Close_Call) RunAndReturn(run func() error) *MockReadSeekCloser_Close_Call { _c.Call.Return(run) return _c } // Read provides a mock function for the type MockReadSeekCloser func (_mock *MockReadSeekCloser) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadSeekCloser_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockReadSeekCloser_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockReadSeekCloser_Expecter) Read(p interface{}) *MockReadSeekCloser_Read_Call { return &MockReadSeekCloser_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockReadSeekCloser_Read_Call) Run(run func(p []byte)) *MockReadSeekCloser_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadSeekCloser_Read_Call) Return(n int, err error) *MockReadSeekCloser_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadSeekCloser_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadSeekCloser_Read_Call { _c.Call.Return(run) return _c } // Seek provides a mock function for the type MockReadSeekCloser func (_mock *MockReadSeekCloser) Seek(offset int64, whence int) (int64, error) { ret := _mock.Called(offset, whence) if len(ret) == 0 { panic("no return value specified for Seek") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(int64, int) (int64, error)); ok { return returnFunc(offset, whence) } if returnFunc, ok := ret.Get(0).(func(int64, int) int64); ok { r0 = returnFunc(offset, whence) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(int64, int) error); ok { r1 = returnFunc(offset, whence) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadSeekCloser_Seek_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seek' type MockReadSeekCloser_Seek_Call struct { *mock.Call } // Seek is a helper method to define mock.On call // - offset int64 // - whence int func (_e *MockReadSeekCloser_Expecter) Seek(offset interface{}, whence interface{}) *MockReadSeekCloser_Seek_Call { return &MockReadSeekCloser_Seek_Call{Call: _e.mock.On("Seek", offset, whence)} } func (_c *MockReadSeekCloser_Seek_Call) Run(run func(offset int64, whence int)) *MockReadSeekCloser_Seek_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int64 if args[0] != nil { arg0 = args[0].(int64) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockReadSeekCloser_Seek_Call) Return(n int64, err error) *MockReadSeekCloser_Seek_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadSeekCloser_Seek_Call) RunAndReturn(run func(offset int64, whence int) (int64, error)) *MockReadSeekCloser_Seek_Call { _c.Call.Return(run) return _c } // NewMockWriteSeeker creates a new instance of MockWriteSeeker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockWriteSeeker(t interface { mock.TestingT Cleanup(func()) }) *MockWriteSeeker { mock := &MockWriteSeeker{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockWriteSeeker is an autogenerated mock type for the WriteSeeker type type MockWriteSeeker struct { mock.Mock } type MockWriteSeeker_Expecter struct { mock *mock.Mock } func (_m *MockWriteSeeker) EXPECT() *MockWriteSeeker_Expecter { return &MockWriteSeeker_Expecter{mock: &_m.Mock} } // Seek provides a mock function for the type MockWriteSeeker func (_mock *MockWriteSeeker) Seek(offset int64, whence int) (int64, error) { ret := _mock.Called(offset, whence) if len(ret) == 0 { panic("no return value specified for Seek") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(int64, int) (int64, error)); ok { return returnFunc(offset, whence) } if returnFunc, ok := ret.Get(0).(func(int64, int) int64); ok { r0 = returnFunc(offset, whence) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(int64, int) error); ok { r1 = returnFunc(offset, whence) } else { r1 = ret.Error(1) } return r0, r1 } // MockWriteSeeker_Seek_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seek' type MockWriteSeeker_Seek_Call struct { *mock.Call } // Seek is a helper method to define mock.On call // - offset int64 // - whence int func (_e *MockWriteSeeker_Expecter) Seek(offset interface{}, whence interface{}) *MockWriteSeeker_Seek_Call { return &MockWriteSeeker_Seek_Call{Call: _e.mock.On("Seek", offset, whence)} } func (_c *MockWriteSeeker_Seek_Call) Run(run func(offset int64, whence int)) *MockWriteSeeker_Seek_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int64 if args[0] != nil { arg0 = args[0].(int64) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockWriteSeeker_Seek_Call) Return(n int64, err error) *MockWriteSeeker_Seek_Call { _c.Call.Return(n, err) return _c } func (_c *MockWriteSeeker_Seek_Call) RunAndReturn(run func(offset int64, whence int) (int64, error)) *MockWriteSeeker_Seek_Call { _c.Call.Return(run) return _c } // Write provides a mock function for the type MockWriteSeeker func (_mock *MockWriteSeeker) Write(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Write") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockWriteSeeker_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' type MockWriteSeeker_Write_Call struct { *mock.Call } // Write is a helper method to define mock.On call // - p []byte func (_e *MockWriteSeeker_Expecter) Write(p interface{}) *MockWriteSeeker_Write_Call { return &MockWriteSeeker_Write_Call{Call: _e.mock.On("Write", p)} } func (_c *MockWriteSeeker_Write_Call) Run(run func(p []byte)) *MockWriteSeeker_Write_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockWriteSeeker_Write_Call) Return(n int, err error) *MockWriteSeeker_Write_Call { _c.Call.Return(n, err) return _c } func (_c *MockWriteSeeker_Write_Call) RunAndReturn(run func(p []byte) (int, error)) *MockWriteSeeker_Write_Call { _c.Call.Return(run) return _c } // NewMockReadWriteSeeker creates a new instance of MockReadWriteSeeker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReadWriteSeeker(t interface { mock.TestingT Cleanup(func()) }) *MockReadWriteSeeker { mock := &MockReadWriteSeeker{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReadWriteSeeker is an autogenerated mock type for the ReadWriteSeeker type type MockReadWriteSeeker struct { mock.Mock } type MockReadWriteSeeker_Expecter struct { mock *mock.Mock } func (_m *MockReadWriteSeeker) EXPECT() *MockReadWriteSeeker_Expecter { return &MockReadWriteSeeker_Expecter{mock: &_m.Mock} } // Read provides a mock function for the type MockReadWriteSeeker func (_mock *MockReadWriteSeeker) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadWriteSeeker_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockReadWriteSeeker_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockReadWriteSeeker_Expecter) Read(p interface{}) *MockReadWriteSeeker_Read_Call { return &MockReadWriteSeeker_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockReadWriteSeeker_Read_Call) Run(run func(p []byte)) *MockReadWriteSeeker_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadWriteSeeker_Read_Call) Return(n int, err error) *MockReadWriteSeeker_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadWriteSeeker_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadWriteSeeker_Read_Call { _c.Call.Return(run) return _c } // Seek provides a mock function for the type MockReadWriteSeeker func (_mock *MockReadWriteSeeker) Seek(offset int64, whence int) (int64, error) { ret := _mock.Called(offset, whence) if len(ret) == 0 { panic("no return value specified for Seek") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(int64, int) (int64, error)); ok { return returnFunc(offset, whence) } if returnFunc, ok := ret.Get(0).(func(int64, int) int64); ok { r0 = returnFunc(offset, whence) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(int64, int) error); ok { r1 = returnFunc(offset, whence) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadWriteSeeker_Seek_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seek' type MockReadWriteSeeker_Seek_Call struct { *mock.Call } // Seek is a helper method to define mock.On call // - offset int64 // - whence int func (_e *MockReadWriteSeeker_Expecter) Seek(offset interface{}, whence interface{}) *MockReadWriteSeeker_Seek_Call { return &MockReadWriteSeeker_Seek_Call{Call: _e.mock.On("Seek", offset, whence)} } func (_c *MockReadWriteSeeker_Seek_Call) Run(run func(offset int64, whence int)) *MockReadWriteSeeker_Seek_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int64 if args[0] != nil { arg0 = args[0].(int64) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockReadWriteSeeker_Seek_Call) Return(n int64, err error) *MockReadWriteSeeker_Seek_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadWriteSeeker_Seek_Call) RunAndReturn(run func(offset int64, whence int) (int64, error)) *MockReadWriteSeeker_Seek_Call { _c.Call.Return(run) return _c } // Write provides a mock function for the type MockReadWriteSeeker func (_mock *MockReadWriteSeeker) Write(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Write") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockReadWriteSeeker_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' type MockReadWriteSeeker_Write_Call struct { *mock.Call } // Write is a helper method to define mock.On call // - p []byte func (_e *MockReadWriteSeeker_Expecter) Write(p interface{}) *MockReadWriteSeeker_Write_Call { return &MockReadWriteSeeker_Write_Call{Call: _e.mock.On("Write", p)} } func (_c *MockReadWriteSeeker_Write_Call) Run(run func(p []byte)) *MockReadWriteSeeker_Write_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockReadWriteSeeker_Write_Call) Return(n int, err error) *MockReadWriteSeeker_Write_Call { _c.Call.Return(n, err) return _c } func (_c *MockReadWriteSeeker_Write_Call) RunAndReturn(run func(p []byte) (int, error)) *MockReadWriteSeeker_Write_Call { _c.Call.Return(run) return _c } // NewMockReaderFrom creates a new instance of MockReaderFrom. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReaderFrom(t interface { mock.TestingT Cleanup(func()) }) *MockReaderFrom { mock := &MockReaderFrom{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReaderFrom is an autogenerated mock type for the ReaderFrom type type MockReaderFrom struct { mock.Mock } type MockReaderFrom_Expecter struct { mock *mock.Mock } func (_m *MockReaderFrom) EXPECT() *MockReaderFrom_Expecter { return &MockReaderFrom_Expecter{mock: &_m.Mock} } // ReadFrom provides a mock function for the type MockReaderFrom func (_mock *MockReaderFrom) ReadFrom(r io.Reader) (int64, error) { ret := _mock.Called(r) if len(ret) == 0 { panic("no return value specified for ReadFrom") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(io.Reader) (int64, error)); ok { return returnFunc(r) } if returnFunc, ok := ret.Get(0).(func(io.Reader) int64); ok { r0 = returnFunc(r) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(io.Reader) error); ok { r1 = returnFunc(r) } else { r1 = ret.Error(1) } return r0, r1 } // MockReaderFrom_ReadFrom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadFrom' type MockReaderFrom_ReadFrom_Call struct { *mock.Call } // ReadFrom is a helper method to define mock.On call // - r io.Reader func (_e *MockReaderFrom_Expecter) ReadFrom(r interface{}) *MockReaderFrom_ReadFrom_Call { return &MockReaderFrom_ReadFrom_Call{Call: _e.mock.On("ReadFrom", r)} } func (_c *MockReaderFrom_ReadFrom_Call) Run(run func(r io.Reader)) *MockReaderFrom_ReadFrom_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 io.Reader if args[0] != nil { arg0 = args[0].(io.Reader) } run( arg0, ) }) return _c } func (_c *MockReaderFrom_ReadFrom_Call) Return(n int64, err error) *MockReaderFrom_ReadFrom_Call { _c.Call.Return(n, err) return _c } func (_c *MockReaderFrom_ReadFrom_Call) RunAndReturn(run func(r io.Reader) (int64, error)) *MockReaderFrom_ReadFrom_Call { _c.Call.Return(run) return _c } // NewMockWriterTo creates a new instance of MockWriterTo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockWriterTo(t interface { mock.TestingT Cleanup(func()) }) *MockWriterTo { mock := &MockWriterTo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockWriterTo is an autogenerated mock type for the WriterTo type type MockWriterTo struct { mock.Mock } type MockWriterTo_Expecter struct { mock *mock.Mock } func (_m *MockWriterTo) EXPECT() *MockWriterTo_Expecter { return &MockWriterTo_Expecter{mock: &_m.Mock} } // WriteTo provides a mock function for the type MockWriterTo func (_mock *MockWriterTo) WriteTo(w io.Writer) (int64, error) { ret := _mock.Called(w) if len(ret) == 0 { panic("no return value specified for WriteTo") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(io.Writer) (int64, error)); ok { return returnFunc(w) } if returnFunc, ok := ret.Get(0).(func(io.Writer) int64); ok { r0 = returnFunc(w) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(io.Writer) error); ok { r1 = returnFunc(w) } else { r1 = ret.Error(1) } return r0, r1 } // MockWriterTo_WriteTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteTo' type MockWriterTo_WriteTo_Call struct { *mock.Call } // WriteTo is a helper method to define mock.On call // - w io.Writer func (_e *MockWriterTo_Expecter) WriteTo(w interface{}) *MockWriterTo_WriteTo_Call { return &MockWriterTo_WriteTo_Call{Call: _e.mock.On("WriteTo", w)} } func (_c *MockWriterTo_WriteTo_Call) Run(run func(w io.Writer)) *MockWriterTo_WriteTo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 io.Writer if args[0] != nil { arg0 = args[0].(io.Writer) } run( arg0, ) }) return _c } func (_c *MockWriterTo_WriteTo_Call) Return(n int64, err error) *MockWriterTo_WriteTo_Call { _c.Call.Return(n, err) return _c } func (_c *MockWriterTo_WriteTo_Call) RunAndReturn(run func(w io.Writer) (int64, error)) *MockWriterTo_WriteTo_Call { _c.Call.Return(run) return _c } // NewMockReaderAt creates a new instance of MockReaderAt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReaderAt(t interface { mock.TestingT Cleanup(func()) }) *MockReaderAt { mock := &MockReaderAt{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReaderAt is an autogenerated mock type for the ReaderAt type type MockReaderAt struct { mock.Mock } type MockReaderAt_Expecter struct { mock *mock.Mock } func (_m *MockReaderAt) EXPECT() *MockReaderAt_Expecter { return &MockReaderAt_Expecter{mock: &_m.Mock} } // ReadAt provides a mock function for the type MockReaderAt func (_mock *MockReaderAt) ReadAt(p []byte, off int64) (int, error) { ret := _mock.Called(p, off) if len(ret) == 0 { panic("no return value specified for ReadAt") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte, int64) (int, error)); ok { return returnFunc(p, off) } if returnFunc, ok := ret.Get(0).(func([]byte, int64) int); ok { r0 = returnFunc(p, off) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte, int64) error); ok { r1 = returnFunc(p, off) } else { r1 = ret.Error(1) } return r0, r1 } // MockReaderAt_ReadAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadAt' type MockReaderAt_ReadAt_Call struct { *mock.Call } // ReadAt is a helper method to define mock.On call // - p []byte // - off int64 func (_e *MockReaderAt_Expecter) ReadAt(p interface{}, off interface{}) *MockReaderAt_ReadAt_Call { return &MockReaderAt_ReadAt_Call{Call: _e.mock.On("ReadAt", p, off)} } func (_c *MockReaderAt_ReadAt_Call) Run(run func(p []byte, off int64)) *MockReaderAt_ReadAt_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } var arg1 int64 if args[1] != nil { arg1 = args[1].(int64) } run( arg0, arg1, ) }) return _c } func (_c *MockReaderAt_ReadAt_Call) Return(n int, err error) *MockReaderAt_ReadAt_Call { _c.Call.Return(n, err) return _c } func (_c *MockReaderAt_ReadAt_Call) RunAndReturn(run func(p []byte, off int64) (int, error)) *MockReaderAt_ReadAt_Call { _c.Call.Return(run) return _c } // NewMockWriterAt creates a new instance of MockWriterAt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockWriterAt(t interface { mock.TestingT Cleanup(func()) }) *MockWriterAt { mock := &MockWriterAt{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockWriterAt is an autogenerated mock type for the WriterAt type type MockWriterAt struct { mock.Mock } type MockWriterAt_Expecter struct { mock *mock.Mock } func (_m *MockWriterAt) EXPECT() *MockWriterAt_Expecter { return &MockWriterAt_Expecter{mock: &_m.Mock} } // WriteAt provides a mock function for the type MockWriterAt func (_mock *MockWriterAt) WriteAt(p []byte, off int64) (int, error) { ret := _mock.Called(p, off) if len(ret) == 0 { panic("no return value specified for WriteAt") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte, int64) (int, error)); ok { return returnFunc(p, off) } if returnFunc, ok := ret.Get(0).(func([]byte, int64) int); ok { r0 = returnFunc(p, off) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte, int64) error); ok { r1 = returnFunc(p, off) } else { r1 = ret.Error(1) } return r0, r1 } // MockWriterAt_WriteAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteAt' type MockWriterAt_WriteAt_Call struct { *mock.Call } // WriteAt is a helper method to define mock.On call // - p []byte // - off int64 func (_e *MockWriterAt_Expecter) WriteAt(p interface{}, off interface{}) *MockWriterAt_WriteAt_Call { return &MockWriterAt_WriteAt_Call{Call: _e.mock.On("WriteAt", p, off)} } func (_c *MockWriterAt_WriteAt_Call) Run(run func(p []byte, off int64)) *MockWriterAt_WriteAt_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } var arg1 int64 if args[1] != nil { arg1 = args[1].(int64) } run( arg0, arg1, ) }) return _c } func (_c *MockWriterAt_WriteAt_Call) Return(n int, err error) *MockWriterAt_WriteAt_Call { _c.Call.Return(n, err) return _c } func (_c *MockWriterAt_WriteAt_Call) RunAndReturn(run func(p []byte, off int64) (int, error)) *MockWriterAt_WriteAt_Call { _c.Call.Return(run) return _c } // NewMockByteReader creates a new instance of MockByteReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockByteReader(t interface { mock.TestingT Cleanup(func()) }) *MockByteReader { mock := &MockByteReader{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockByteReader is an autogenerated mock type for the ByteReader type type MockByteReader struct { mock.Mock } type MockByteReader_Expecter struct { mock *mock.Mock } func (_m *MockByteReader) EXPECT() *MockByteReader_Expecter { return &MockByteReader_Expecter{mock: &_m.Mock} } // ReadByte provides a mock function for the type MockByteReader func (_mock *MockByteReader) ReadByte() (byte, error) { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ReadByte") } var r0 byte var r1 error if returnFunc, ok := ret.Get(0).(func() (byte, error)); ok { return returnFunc() } if returnFunc, ok := ret.Get(0).(func() byte); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(byte) } if returnFunc, ok := ret.Get(1).(func() error); ok { r1 = returnFunc() } else { r1 = ret.Error(1) } return r0, r1 } // MockByteReader_ReadByte_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadByte' type MockByteReader_ReadByte_Call struct { *mock.Call } // ReadByte is a helper method to define mock.On call func (_e *MockByteReader_Expecter) ReadByte() *MockByteReader_ReadByte_Call { return &MockByteReader_ReadByte_Call{Call: _e.mock.On("ReadByte")} } func (_c *MockByteReader_ReadByte_Call) Run(run func()) *MockByteReader_ReadByte_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockByteReader_ReadByte_Call) Return(v byte, err error) *MockByteReader_ReadByte_Call { _c.Call.Return(v, err) return _c } func (_c *MockByteReader_ReadByte_Call) RunAndReturn(run func() (byte, error)) *MockByteReader_ReadByte_Call { _c.Call.Return(run) return _c } // NewMockByteScanner creates a new instance of MockByteScanner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockByteScanner(t interface { mock.TestingT Cleanup(func()) }) *MockByteScanner { mock := &MockByteScanner{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockByteScanner is an autogenerated mock type for the ByteScanner type type MockByteScanner struct { mock.Mock } type MockByteScanner_Expecter struct { mock *mock.Mock } func (_m *MockByteScanner) EXPECT() *MockByteScanner_Expecter { return &MockByteScanner_Expecter{mock: &_m.Mock} } // ReadByte provides a mock function for the type MockByteScanner func (_mock *MockByteScanner) ReadByte() (byte, error) { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ReadByte") } var r0 byte var r1 error if returnFunc, ok := ret.Get(0).(func() (byte, error)); ok { return returnFunc() } if returnFunc, ok := ret.Get(0).(func() byte); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(byte) } if returnFunc, ok := ret.Get(1).(func() error); ok { r1 = returnFunc() } else { r1 = ret.Error(1) } return r0, r1 } // MockByteScanner_ReadByte_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadByte' type MockByteScanner_ReadByte_Call struct { *mock.Call } // ReadByte is a helper method to define mock.On call func (_e *MockByteScanner_Expecter) ReadByte() *MockByteScanner_ReadByte_Call { return &MockByteScanner_ReadByte_Call{Call: _e.mock.On("ReadByte")} } func (_c *MockByteScanner_ReadByte_Call) Run(run func()) *MockByteScanner_ReadByte_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockByteScanner_ReadByte_Call) Return(v byte, err error) *MockByteScanner_ReadByte_Call { _c.Call.Return(v, err) return _c } func (_c *MockByteScanner_ReadByte_Call) RunAndReturn(run func() (byte, error)) *MockByteScanner_ReadByte_Call { _c.Call.Return(run) return _c } // UnreadByte provides a mock function for the type MockByteScanner func (_mock *MockByteScanner) UnreadByte() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for UnreadByte") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockByteScanner_UnreadByte_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnreadByte' type MockByteScanner_UnreadByte_Call struct { *mock.Call } // UnreadByte is a helper method to define mock.On call func (_e *MockByteScanner_Expecter) UnreadByte() *MockByteScanner_UnreadByte_Call { return &MockByteScanner_UnreadByte_Call{Call: _e.mock.On("UnreadByte")} } func (_c *MockByteScanner_UnreadByte_Call) Run(run func()) *MockByteScanner_UnreadByte_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockByteScanner_UnreadByte_Call) Return(err error) *MockByteScanner_UnreadByte_Call { _c.Call.Return(err) return _c } func (_c *MockByteScanner_UnreadByte_Call) RunAndReturn(run func() error) *MockByteScanner_UnreadByte_Call { _c.Call.Return(run) return _c } // NewMockByteWriter creates a new instance of MockByteWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockByteWriter(t interface { mock.TestingT Cleanup(func()) }) *MockByteWriter { mock := &MockByteWriter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockByteWriter is an autogenerated mock type for the ByteWriter type type MockByteWriter struct { mock.Mock } type MockByteWriter_Expecter struct { mock *mock.Mock } func (_m *MockByteWriter) EXPECT() *MockByteWriter_Expecter { return &MockByteWriter_Expecter{mock: &_m.Mock} } // WriteByte provides a mock function for the type MockByteWriter func (_mock *MockByteWriter) WriteByte(c byte) error { ret := _mock.Called(c) if len(ret) == 0 { panic("no return value specified for WriteByte") } var r0 error if returnFunc, ok := ret.Get(0).(func(byte) error); ok { r0 = returnFunc(c) } else { r0 = ret.Error(0) } return r0 } // MockByteWriter_WriteByte_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteByte' type MockByteWriter_WriteByte_Call struct { *mock.Call } // WriteByte is a helper method to define mock.On call // - c byte func (_e *MockByteWriter_Expecter) WriteByte(c interface{}) *MockByteWriter_WriteByte_Call { return &MockByteWriter_WriteByte_Call{Call: _e.mock.On("WriteByte", c)} } func (_c *MockByteWriter_WriteByte_Call) Run(run func(c byte)) *MockByteWriter_WriteByte_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 byte if args[0] != nil { arg0 = args[0].(byte) } run( arg0, ) }) return _c } func (_c *MockByteWriter_WriteByte_Call) Return(err error) *MockByteWriter_WriteByte_Call { _c.Call.Return(err) return _c } func (_c *MockByteWriter_WriteByte_Call) RunAndReturn(run func(c byte) error) *MockByteWriter_WriteByte_Call { _c.Call.Return(run) return _c } // NewMockRuneReader creates a new instance of MockRuneReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRuneReader(t interface { mock.TestingT Cleanup(func()) }) *MockRuneReader { mock := &MockRuneReader{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRuneReader is an autogenerated mock type for the RuneReader type type MockRuneReader struct { mock.Mock } type MockRuneReader_Expecter struct { mock *mock.Mock } func (_m *MockRuneReader) EXPECT() *MockRuneReader_Expecter { return &MockRuneReader_Expecter{mock: &_m.Mock} } // ReadRune provides a mock function for the type MockRuneReader func (_mock *MockRuneReader) ReadRune() (rune, int, error) { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ReadRune") } var r0 rune var r1 int var r2 error if returnFunc, ok := ret.Get(0).(func() (rune, int, error)); ok { return returnFunc() } if returnFunc, ok := ret.Get(0).(func() rune); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(rune) } if returnFunc, ok := ret.Get(1).(func() int); ok { r1 = returnFunc() } else { r1 = ret.Get(1).(int) } if returnFunc, ok := ret.Get(2).(func() error); ok { r2 = returnFunc() } else { r2 = ret.Error(2) } return r0, r1, r2 } // MockRuneReader_ReadRune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadRune' type MockRuneReader_ReadRune_Call struct { *mock.Call } // ReadRune is a helper method to define mock.On call func (_e *MockRuneReader_Expecter) ReadRune() *MockRuneReader_ReadRune_Call { return &MockRuneReader_ReadRune_Call{Call: _e.mock.On("ReadRune")} } func (_c *MockRuneReader_ReadRune_Call) Run(run func()) *MockRuneReader_ReadRune_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockRuneReader_ReadRune_Call) Return(r rune, size int, err error) *MockRuneReader_ReadRune_Call { _c.Call.Return(r, size, err) return _c } func (_c *MockRuneReader_ReadRune_Call) RunAndReturn(run func() (rune, int, error)) *MockRuneReader_ReadRune_Call { _c.Call.Return(run) return _c } // NewMockRuneScanner creates a new instance of MockRuneScanner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRuneScanner(t interface { mock.TestingT Cleanup(func()) }) *MockRuneScanner { mock := &MockRuneScanner{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRuneScanner is an autogenerated mock type for the RuneScanner type type MockRuneScanner struct { mock.Mock } type MockRuneScanner_Expecter struct { mock *mock.Mock } func (_m *MockRuneScanner) EXPECT() *MockRuneScanner_Expecter { return &MockRuneScanner_Expecter{mock: &_m.Mock} } // ReadRune provides a mock function for the type MockRuneScanner func (_mock *MockRuneScanner) ReadRune() (rune, int, error) { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ReadRune") } var r0 rune var r1 int var r2 error if returnFunc, ok := ret.Get(0).(func() (rune, int, error)); ok { return returnFunc() } if returnFunc, ok := ret.Get(0).(func() rune); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(rune) } if returnFunc, ok := ret.Get(1).(func() int); ok { r1 = returnFunc() } else { r1 = ret.Get(1).(int) } if returnFunc, ok := ret.Get(2).(func() error); ok { r2 = returnFunc() } else { r2 = ret.Error(2) } return r0, r1, r2 } // MockRuneScanner_ReadRune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadRune' type MockRuneScanner_ReadRune_Call struct { *mock.Call } // ReadRune is a helper method to define mock.On call func (_e *MockRuneScanner_Expecter) ReadRune() *MockRuneScanner_ReadRune_Call { return &MockRuneScanner_ReadRune_Call{Call: _e.mock.On("ReadRune")} } func (_c *MockRuneScanner_ReadRune_Call) Run(run func()) *MockRuneScanner_ReadRune_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockRuneScanner_ReadRune_Call) Return(r rune, size int, err error) *MockRuneScanner_ReadRune_Call { _c.Call.Return(r, size, err) return _c } func (_c *MockRuneScanner_ReadRune_Call) RunAndReturn(run func() (rune, int, error)) *MockRuneScanner_ReadRune_Call { _c.Call.Return(run) return _c } // UnreadRune provides a mock function for the type MockRuneScanner func (_mock *MockRuneScanner) UnreadRune() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for UnreadRune") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockRuneScanner_UnreadRune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnreadRune' type MockRuneScanner_UnreadRune_Call struct { *mock.Call } // UnreadRune is a helper method to define mock.On call func (_e *MockRuneScanner_Expecter) UnreadRune() *MockRuneScanner_UnreadRune_Call { return &MockRuneScanner_UnreadRune_Call{Call: _e.mock.On("UnreadRune")} } func (_c *MockRuneScanner_UnreadRune_Call) Run(run func()) *MockRuneScanner_UnreadRune_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockRuneScanner_UnreadRune_Call) Return(err error) *MockRuneScanner_UnreadRune_Call { _c.Call.Return(err) return _c } func (_c *MockRuneScanner_UnreadRune_Call) RunAndReturn(run func() error) *MockRuneScanner_UnreadRune_Call { _c.Call.Return(run) return _c } // NewMockStringWriter creates a new instance of MockStringWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockStringWriter(t interface { mock.TestingT Cleanup(func()) }) *MockStringWriter { mock := &MockStringWriter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockStringWriter is an autogenerated mock type for the StringWriter type type MockStringWriter struct { mock.Mock } type MockStringWriter_Expecter struct { mock *mock.Mock } func (_m *MockStringWriter) EXPECT() *MockStringWriter_Expecter { return &MockStringWriter_Expecter{mock: &_m.Mock} } // WriteString provides a mock function for the type MockStringWriter func (_mock *MockStringWriter) WriteString(s string) (int, error) { ret := _mock.Called(s) if len(ret) == 0 { panic("no return value specified for WriteString") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func(string) (int, error)); ok { return returnFunc(s) } if returnFunc, ok := ret.Get(0).(func(string) int); ok { r0 = returnFunc(s) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(s) } else { r1 = ret.Error(1) } return r0, r1 } // MockStringWriter_WriteString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteString' type MockStringWriter_WriteString_Call struct { *mock.Call } // WriteString is a helper method to define mock.On call // - s string func (_e *MockStringWriter_Expecter) WriteString(s interface{}) *MockStringWriter_WriteString_Call { return &MockStringWriter_WriteString_Call{Call: _e.mock.On("WriteString", s)} } func (_c *MockStringWriter_WriteString_Call) Run(run func(s string)) *MockStringWriter_WriteString_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockStringWriter_WriteString_Call) Return(n int, err error) *MockStringWriter_WriteString_Call { _c.Call.Return(n, err) return _c } func (_c *MockStringWriter_WriteString_Call) RunAndReturn(run func(s string) (int, error)) *MockStringWriter_WriteString_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/mocks_matryer_test_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer package test import ( "encoding/json" "io" "net/http" "sync" "unsafe" http1 "github.com/vektra/mockery/v3/internal/fixtures/12345678/http" "github.com/vektra/mockery/v3/internal/fixtures/constraints" http0 "github.com/vektra/mockery/v3/internal/fixtures/http" "github.com/vektra/mockery/v3/internal/fixtures/redefined_type_b" ) // Ensure that MoqUsesAny does implement UsesAny. // If this is not the case, regenerate this file with mockery. var _ UsesAny = &MoqUsesAny{} // MoqUsesAny is a mock implementation of UsesAny. // // func TestSomethingThatUsesUsesAny(t *testing.T) { // // // make and configure a mocked UsesAny // mockedUsesAny := &MoqUsesAny{ // GetReaderFunc: func() any { // panic("mock out the GetReader method") // }, // } // // // use mockedUsesAny in code that requires UsesAny // // and then make assertions. // // } type MoqUsesAny struct { // GetReaderFunc mocks the GetReader method. GetReaderFunc func() any // calls tracks calls to the methods. calls struct { // GetReader holds details about calls to the GetReader method. GetReader []struct { } } lockGetReader sync.RWMutex } // GetReader calls GetReaderFunc. func (mock *MoqUsesAny) GetReader() any { callInfo := struct { }{} mock.lockGetReader.Lock() mock.calls.GetReader = append(mock.calls.GetReader, callInfo) mock.lockGetReader.Unlock() if mock.GetReaderFunc == nil { var ( v any ) return v } return mock.GetReaderFunc() } // GetReaderCalls gets all the calls that were made to GetReader. // Check the length with: // // len(mockedUsesAny.GetReaderCalls()) func (mock *MoqUsesAny) GetReaderCalls() []struct { } { var calls []struct { } mock.lockGetReader.RLock() calls = mock.calls.GetReader mock.lockGetReader.RUnlock() return calls } // ResetGetReaderCalls reset all the calls that were made to GetReader. func (mock *MoqUsesAny) ResetGetReaderCalls() { mock.lockGetReader.Lock() mock.calls.GetReader = nil mock.lockGetReader.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqUsesAny) ResetCalls() { mock.lockGetReader.Lock() mock.calls.GetReader = nil mock.lockGetReader.Unlock() } // Ensure that MoqFooer does implement Fooer. // If this is not the case, regenerate this file with mockery. var _ Fooer = &MoqFooer{} // MoqFooer is a mock implementation of Fooer. // // func TestSomethingThatUsesFooer(t *testing.T) { // // // make and configure a mocked Fooer // mockedFooer := &MoqFooer{ // BarFunc: func(f func([]int)) { // panic("mock out the Bar method") // }, // BazFunc: func(path string) func(x string) string { // panic("mock out the Baz method") // }, // FooFunc: func(f func(x string) string) error { // panic("mock out the Foo method") // }, // } // // // use mockedFooer in code that requires Fooer // // and then make assertions. // // } type MoqFooer struct { // BarFunc mocks the Bar method. BarFunc func(f func([]int)) // BazFunc mocks the Baz method. BazFunc func(path string) func(x string) string // FooFunc mocks the Foo method. FooFunc func(f func(x string) string) error // calls tracks calls to the methods. calls struct { // Bar holds details about calls to the Bar method. Bar []struct { // F is the f argument value. F func([]int) } // Baz holds details about calls to the Baz method. Baz []struct { // Path is the path argument value. Path string } // Foo holds details about calls to the Foo method. Foo []struct { // F is the f argument value. F func(x string) string } } lockBar sync.RWMutex lockBaz sync.RWMutex lockFoo sync.RWMutex } // Bar calls BarFunc. func (mock *MoqFooer) Bar(f func([]int)) { callInfo := struct { F func([]int) }{ F: f, } mock.lockBar.Lock() mock.calls.Bar = append(mock.calls.Bar, callInfo) mock.lockBar.Unlock() if mock.BarFunc == nil { return } mock.BarFunc(f) } // BarCalls gets all the calls that were made to Bar. // Check the length with: // // len(mockedFooer.BarCalls()) func (mock *MoqFooer) BarCalls() []struct { F func([]int) } { var calls []struct { F func([]int) } mock.lockBar.RLock() calls = mock.calls.Bar mock.lockBar.RUnlock() return calls } // ResetBarCalls reset all the calls that were made to Bar. func (mock *MoqFooer) ResetBarCalls() { mock.lockBar.Lock() mock.calls.Bar = nil mock.lockBar.Unlock() } // Baz calls BazFunc. func (mock *MoqFooer) Baz(path string) func(x string) string { callInfo := struct { Path string }{ Path: path, } mock.lockBaz.Lock() mock.calls.Baz = append(mock.calls.Baz, callInfo) mock.lockBaz.Unlock() if mock.BazFunc == nil { var ( fn func(x string) string ) return fn } return mock.BazFunc(path) } // BazCalls gets all the calls that were made to Baz. // Check the length with: // // len(mockedFooer.BazCalls()) func (mock *MoqFooer) BazCalls() []struct { Path string } { var calls []struct { Path string } mock.lockBaz.RLock() calls = mock.calls.Baz mock.lockBaz.RUnlock() return calls } // ResetBazCalls reset all the calls that were made to Baz. func (mock *MoqFooer) ResetBazCalls() { mock.lockBaz.Lock() mock.calls.Baz = nil mock.lockBaz.Unlock() } // Foo calls FooFunc. func (mock *MoqFooer) Foo(f func(x string) string) error { callInfo := struct { F func(x string) string }{ F: f, } mock.lockFoo.Lock() mock.calls.Foo = append(mock.calls.Foo, callInfo) mock.lockFoo.Unlock() if mock.FooFunc == nil { var ( err error ) return err } return mock.FooFunc(f) } // FooCalls gets all the calls that were made to Foo. // Check the length with: // // len(mockedFooer.FooCalls()) func (mock *MoqFooer) FooCalls() []struct { F func(x string) string } { var calls []struct { F func(x string) string } mock.lockFoo.RLock() calls = mock.calls.Foo mock.lockFoo.RUnlock() return calls } // ResetFooCalls reset all the calls that were made to Foo. func (mock *MoqFooer) ResetFooCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqFooer) ResetCalls() { mock.lockBar.Lock() mock.calls.Bar = nil mock.lockBar.Unlock() mock.lockBaz.Lock() mock.calls.Baz = nil mock.lockBaz.Unlock() mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // Ensure that MoqMapFunc does implement MapFunc. // If this is not the case, regenerate this file with mockery. var _ MapFunc = &MoqMapFunc{} // MoqMapFunc is a mock implementation of MapFunc. // // func TestSomethingThatUsesMapFunc(t *testing.T) { // // // make and configure a mocked MapFunc // mockedMapFunc := &MoqMapFunc{ // GetFunc: func(m map[string]func(string) string) error { // panic("mock out the Get method") // }, // } // // // use mockedMapFunc in code that requires MapFunc // // and then make assertions. // // } type MoqMapFunc struct { // GetFunc mocks the Get method. GetFunc func(m map[string]func(string) string) error // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // M is the m argument value. M map[string]func(string) string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqMapFunc) Get(m map[string]func(string) string) error { callInfo := struct { M map[string]func(string) string }{ M: m, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( err error ) return err } return mock.GetFunc(m) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedMapFunc.GetCalls()) func (mock *MoqMapFunc) GetCalls() []struct { M map[string]func(string) string } { var calls []struct { M map[string]func(string) string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqMapFunc) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqMapFunc) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqAsyncProducer does implement AsyncProducer. // If this is not the case, regenerate this file with mockery. var _ AsyncProducer = &MoqAsyncProducer{} // MoqAsyncProducer is a mock implementation of AsyncProducer. // // func TestSomethingThatUsesAsyncProducer(t *testing.T) { // // // make and configure a mocked AsyncProducer // mockedAsyncProducer := &MoqAsyncProducer{ // InputFunc: func() chan<- bool { // panic("mock out the Input method") // }, // OutputFunc: func() <-chan bool { // panic("mock out the Output method") // }, // WhateverFunc: func() chan bool { // panic("mock out the Whatever method") // }, // } // // // use mockedAsyncProducer in code that requires AsyncProducer // // and then make assertions. // // } type MoqAsyncProducer struct { // InputFunc mocks the Input method. InputFunc func() chan<- bool // OutputFunc mocks the Output method. OutputFunc func() <-chan bool // WhateverFunc mocks the Whatever method. WhateverFunc func() chan bool // calls tracks calls to the methods. calls struct { // Input holds details about calls to the Input method. Input []struct { } // Output holds details about calls to the Output method. Output []struct { } // Whatever holds details about calls to the Whatever method. Whatever []struct { } } lockInput sync.RWMutex lockOutput sync.RWMutex lockWhatever sync.RWMutex } // Input calls InputFunc. func (mock *MoqAsyncProducer) Input() chan<- bool { callInfo := struct { }{} mock.lockInput.Lock() mock.calls.Input = append(mock.calls.Input, callInfo) mock.lockInput.Unlock() if mock.InputFunc == nil { var ( boolCh chan<- bool ) return boolCh } return mock.InputFunc() } // InputCalls gets all the calls that were made to Input. // Check the length with: // // len(mockedAsyncProducer.InputCalls()) func (mock *MoqAsyncProducer) InputCalls() []struct { } { var calls []struct { } mock.lockInput.RLock() calls = mock.calls.Input mock.lockInput.RUnlock() return calls } // ResetInputCalls reset all the calls that were made to Input. func (mock *MoqAsyncProducer) ResetInputCalls() { mock.lockInput.Lock() mock.calls.Input = nil mock.lockInput.Unlock() } // Output calls OutputFunc. func (mock *MoqAsyncProducer) Output() <-chan bool { callInfo := struct { }{} mock.lockOutput.Lock() mock.calls.Output = append(mock.calls.Output, callInfo) mock.lockOutput.Unlock() if mock.OutputFunc == nil { var ( boolCh <-chan bool ) return boolCh } return mock.OutputFunc() } // OutputCalls gets all the calls that were made to Output. // Check the length with: // // len(mockedAsyncProducer.OutputCalls()) func (mock *MoqAsyncProducer) OutputCalls() []struct { } { var calls []struct { } mock.lockOutput.RLock() calls = mock.calls.Output mock.lockOutput.RUnlock() return calls } // ResetOutputCalls reset all the calls that were made to Output. func (mock *MoqAsyncProducer) ResetOutputCalls() { mock.lockOutput.Lock() mock.calls.Output = nil mock.lockOutput.Unlock() } // Whatever calls WhateverFunc. func (mock *MoqAsyncProducer) Whatever() chan bool { callInfo := struct { }{} mock.lockWhatever.Lock() mock.calls.Whatever = append(mock.calls.Whatever, callInfo) mock.lockWhatever.Unlock() if mock.WhateverFunc == nil { var ( boolCh chan bool ) return boolCh } return mock.WhateverFunc() } // WhateverCalls gets all the calls that were made to Whatever. // Check the length with: // // len(mockedAsyncProducer.WhateverCalls()) func (mock *MoqAsyncProducer) WhateverCalls() []struct { } { var calls []struct { } mock.lockWhatever.RLock() calls = mock.calls.Whatever mock.lockWhatever.RUnlock() return calls } // ResetWhateverCalls reset all the calls that were made to Whatever. func (mock *MoqAsyncProducer) ResetWhateverCalls() { mock.lockWhatever.Lock() mock.calls.Whatever = nil mock.lockWhatever.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqAsyncProducer) ResetCalls() { mock.lockInput.Lock() mock.calls.Input = nil mock.lockInput.Unlock() mock.lockOutput.Lock() mock.calls.Output = nil mock.lockOutput.Unlock() mock.lockWhatever.Lock() mock.calls.Whatever = nil mock.lockWhatever.Unlock() } // Ensure that MoqConsulLock does implement ConsulLock. // If this is not the case, regenerate this file with mockery. var _ ConsulLock = &MoqConsulLock{} // MoqConsulLock is a mock implementation of ConsulLock. // // func TestSomethingThatUsesConsulLock(t *testing.T) { // // // make and configure a mocked ConsulLock // mockedConsulLock := &MoqConsulLock{ // LockFunc: func(valCh <-chan struct{}) (<-chan struct{}, error) { // panic("mock out the Lock method") // }, // UnlockFunc: func() error { // panic("mock out the Unlock method") // }, // } // // // use mockedConsulLock in code that requires ConsulLock // // and then make assertions. // // } type MoqConsulLock struct { // LockFunc mocks the Lock method. LockFunc func(valCh <-chan struct{}) (<-chan struct{}, error) // UnlockFunc mocks the Unlock method. UnlockFunc func() error // calls tracks calls to the methods. calls struct { // Lock holds details about calls to the Lock method. Lock []struct { // ValCh is the valCh argument value. ValCh <-chan struct{} } // Unlock holds details about calls to the Unlock method. Unlock []struct { } } lockLock sync.RWMutex lockUnlock sync.RWMutex } // Lock calls LockFunc. func (mock *MoqConsulLock) Lock(valCh <-chan struct{}) (<-chan struct{}, error) { callInfo := struct { ValCh <-chan struct{} }{ ValCh: valCh, } mock.lockLock.Lock() mock.calls.Lock = append(mock.calls.Lock, callInfo) mock.lockLock.Unlock() if mock.LockFunc == nil { var ( valCh1 <-chan struct{} err error ) return valCh1, err } return mock.LockFunc(valCh) } // LockCalls gets all the calls that were made to Lock. // Check the length with: // // len(mockedConsulLock.LockCalls()) func (mock *MoqConsulLock) LockCalls() []struct { ValCh <-chan struct{} } { var calls []struct { ValCh <-chan struct{} } mock.lockLock.RLock() calls = mock.calls.Lock mock.lockLock.RUnlock() return calls } // ResetLockCalls reset all the calls that were made to Lock. func (mock *MoqConsulLock) ResetLockCalls() { mock.lockLock.Lock() mock.calls.Lock = nil mock.lockLock.Unlock() } // Unlock calls UnlockFunc. func (mock *MoqConsulLock) Unlock() error { callInfo := struct { }{} mock.lockUnlock.Lock() mock.calls.Unlock = append(mock.calls.Unlock, callInfo) mock.lockUnlock.Unlock() if mock.UnlockFunc == nil { var ( err error ) return err } return mock.UnlockFunc() } // UnlockCalls gets all the calls that were made to Unlock. // Check the length with: // // len(mockedConsulLock.UnlockCalls()) func (mock *MoqConsulLock) UnlockCalls() []struct { } { var calls []struct { } mock.lockUnlock.RLock() calls = mock.calls.Unlock mock.lockUnlock.RUnlock() return calls } // ResetUnlockCalls reset all the calls that were made to Unlock. func (mock *MoqConsulLock) ResetUnlockCalls() { mock.lockUnlock.Lock() mock.calls.Unlock = nil mock.lockUnlock.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqConsulLock) ResetCalls() { mock.lockLock.Lock() mock.calls.Lock = nil mock.lockLock.Unlock() mock.lockUnlock.Lock() mock.calls.Unlock = nil mock.lockUnlock.Unlock() } // Ensure that MoqKeyManager does implement KeyManager. // If this is not the case, regenerate this file with mockery. var _ KeyManager = &MoqKeyManager{} // MoqKeyManager is a mock implementation of KeyManager. // // func TestSomethingThatUsesKeyManager(t *testing.T) { // // // make and configure a mocked KeyManager // mockedKeyManager := &MoqKeyManager{ // GetKeyFunc: func(s string, v uint16) ([]byte, *Err) { // panic("mock out the GetKey method") // }, // } // // // use mockedKeyManager in code that requires KeyManager // // and then make assertions. // // } type MoqKeyManager struct { // GetKeyFunc mocks the GetKey method. GetKeyFunc func(s string, v uint16) ([]byte, *Err) // calls tracks calls to the methods. calls struct { // GetKey holds details about calls to the GetKey method. GetKey []struct { // S is the s argument value. S string // V is the v argument value. V uint16 } } lockGetKey sync.RWMutex } // GetKey calls GetKeyFunc. func (mock *MoqKeyManager) GetKey(s string, v uint16) ([]byte, *Err) { callInfo := struct { S string V uint16 }{ S: s, V: v, } mock.lockGetKey.Lock() mock.calls.GetKey = append(mock.calls.GetKey, callInfo) mock.lockGetKey.Unlock() if mock.GetKeyFunc == nil { var ( bytes []byte err *Err ) return bytes, err } return mock.GetKeyFunc(s, v) } // GetKeyCalls gets all the calls that were made to GetKey. // Check the length with: // // len(mockedKeyManager.GetKeyCalls()) func (mock *MoqKeyManager) GetKeyCalls() []struct { S string V uint16 } { var calls []struct { S string V uint16 } mock.lockGetKey.RLock() calls = mock.calls.GetKey mock.lockGetKey.RUnlock() return calls } // ResetGetKeyCalls reset all the calls that were made to GetKey. func (mock *MoqKeyManager) ResetGetKeyCalls() { mock.lockGetKey.Lock() mock.calls.GetKey = nil mock.lockGetKey.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqKeyManager) ResetCalls() { mock.lockGetKey.Lock() mock.calls.GetKey = nil mock.lockGetKey.Unlock() } // Ensure that MoqBlank does implement Blank. // If this is not the case, regenerate this file with mockery. var _ Blank = &MoqBlank{} // MoqBlank is a mock implementation of Blank. // // func TestSomethingThatUsesBlank(t *testing.T) { // // // make and configure a mocked Blank // mockedBlank := &MoqBlank{ // CreateFunc: func(x interface{}) error { // panic("mock out the Create method") // }, // } // // // use mockedBlank in code that requires Blank // // and then make assertions. // // } type MoqBlank struct { // CreateFunc mocks the Create method. CreateFunc func(x interface{}) error // calls tracks calls to the methods. calls struct { // Create holds details about calls to the Create method. Create []struct { // X is the x argument value. X interface{} } } lockCreate sync.RWMutex } // Create calls CreateFunc. func (mock *MoqBlank) Create(x interface{}) error { callInfo := struct { X interface{} }{ X: x, } mock.lockCreate.Lock() mock.calls.Create = append(mock.calls.Create, callInfo) mock.lockCreate.Unlock() if mock.CreateFunc == nil { var ( err error ) return err } return mock.CreateFunc(x) } // CreateCalls gets all the calls that were made to Create. // Check the length with: // // len(mockedBlank.CreateCalls()) func (mock *MoqBlank) CreateCalls() []struct { X interface{} } { var calls []struct { X interface{} } mock.lockCreate.RLock() calls = mock.calls.Create mock.lockCreate.RUnlock() return calls } // ResetCreateCalls reset all the calls that were made to Create. func (mock *MoqBlank) ResetCreateCalls() { mock.lockCreate.Lock() mock.calls.Create = nil mock.lockCreate.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqBlank) ResetCalls() { mock.lockCreate.Lock() mock.calls.Create = nil mock.lockCreate.Unlock() } // Ensure that MoqExpecter does implement Expecter. // If this is not the case, regenerate this file with mockery. var _ Expecter = &MoqExpecter{} // MoqExpecter is a mock implementation of Expecter. // // func TestSomethingThatUsesExpecter(t *testing.T) { // // // make and configure a mocked Expecter // mockedExpecter := &MoqExpecter{ // ManyArgsReturnsFunc: func(str string, i int) ([]string, error) { // panic("mock out the ManyArgsReturns method") // }, // NoArgFunc: func() string { // panic("mock out the NoArg method") // }, // NoReturnFunc: func(str string) { // panic("mock out the NoReturn method") // }, // VariadicFunc: func(ints ...int) error { // panic("mock out the Variadic method") // }, // VariadicManyFunc: func(i int, a string, intfs ...interface{}) error { // panic("mock out the VariadicMany method") // }, // } // // // use mockedExpecter in code that requires Expecter // // and then make assertions. // // } type MoqExpecter struct { // ManyArgsReturnsFunc mocks the ManyArgsReturns method. ManyArgsReturnsFunc func(str string, i int) ([]string, error) // NoArgFunc mocks the NoArg method. NoArgFunc func() string // NoReturnFunc mocks the NoReturn method. NoReturnFunc func(str string) // VariadicFunc mocks the Variadic method. VariadicFunc func(ints ...int) error // VariadicManyFunc mocks the VariadicMany method. VariadicManyFunc func(i int, a string, intfs ...interface{}) error // calls tracks calls to the methods. calls struct { // ManyArgsReturns holds details about calls to the ManyArgsReturns method. ManyArgsReturns []struct { // Str is the str argument value. Str string // I is the i argument value. I int } // NoArg holds details about calls to the NoArg method. NoArg []struct { } // NoReturn holds details about calls to the NoReturn method. NoReturn []struct { // Str is the str argument value. Str string } // Variadic holds details about calls to the Variadic method. Variadic []struct { // Ints is the ints argument value. Ints []int } // VariadicMany holds details about calls to the VariadicMany method. VariadicMany []struct { // I is the i argument value. I int // A is the a argument value. A string // Intfs is the intfs argument value. Intfs []interface{} } } lockManyArgsReturns sync.RWMutex lockNoArg sync.RWMutex lockNoReturn sync.RWMutex lockVariadic sync.RWMutex lockVariadicMany sync.RWMutex } // ManyArgsReturns calls ManyArgsReturnsFunc. func (mock *MoqExpecter) ManyArgsReturns(str string, i int) ([]string, error) { callInfo := struct { Str string I int }{ Str: str, I: i, } mock.lockManyArgsReturns.Lock() mock.calls.ManyArgsReturns = append(mock.calls.ManyArgsReturns, callInfo) mock.lockManyArgsReturns.Unlock() if mock.ManyArgsReturnsFunc == nil { var ( strs []string err error ) return strs, err } return mock.ManyArgsReturnsFunc(str, i) } // ManyArgsReturnsCalls gets all the calls that were made to ManyArgsReturns. // Check the length with: // // len(mockedExpecter.ManyArgsReturnsCalls()) func (mock *MoqExpecter) ManyArgsReturnsCalls() []struct { Str string I int } { var calls []struct { Str string I int } mock.lockManyArgsReturns.RLock() calls = mock.calls.ManyArgsReturns mock.lockManyArgsReturns.RUnlock() return calls } // ResetManyArgsReturnsCalls reset all the calls that were made to ManyArgsReturns. func (mock *MoqExpecter) ResetManyArgsReturnsCalls() { mock.lockManyArgsReturns.Lock() mock.calls.ManyArgsReturns = nil mock.lockManyArgsReturns.Unlock() } // NoArg calls NoArgFunc. func (mock *MoqExpecter) NoArg() string { callInfo := struct { }{} mock.lockNoArg.Lock() mock.calls.NoArg = append(mock.calls.NoArg, callInfo) mock.lockNoArg.Unlock() if mock.NoArgFunc == nil { var ( s string ) return s } return mock.NoArgFunc() } // NoArgCalls gets all the calls that were made to NoArg. // Check the length with: // // len(mockedExpecter.NoArgCalls()) func (mock *MoqExpecter) NoArgCalls() []struct { } { var calls []struct { } mock.lockNoArg.RLock() calls = mock.calls.NoArg mock.lockNoArg.RUnlock() return calls } // ResetNoArgCalls reset all the calls that were made to NoArg. func (mock *MoqExpecter) ResetNoArgCalls() { mock.lockNoArg.Lock() mock.calls.NoArg = nil mock.lockNoArg.Unlock() } // NoReturn calls NoReturnFunc. func (mock *MoqExpecter) NoReturn(str string) { callInfo := struct { Str string }{ Str: str, } mock.lockNoReturn.Lock() mock.calls.NoReturn = append(mock.calls.NoReturn, callInfo) mock.lockNoReturn.Unlock() if mock.NoReturnFunc == nil { return } mock.NoReturnFunc(str) } // NoReturnCalls gets all the calls that were made to NoReturn. // Check the length with: // // len(mockedExpecter.NoReturnCalls()) func (mock *MoqExpecter) NoReturnCalls() []struct { Str string } { var calls []struct { Str string } mock.lockNoReturn.RLock() calls = mock.calls.NoReturn mock.lockNoReturn.RUnlock() return calls } // ResetNoReturnCalls reset all the calls that were made to NoReturn. func (mock *MoqExpecter) ResetNoReturnCalls() { mock.lockNoReturn.Lock() mock.calls.NoReturn = nil mock.lockNoReturn.Unlock() } // Variadic calls VariadicFunc. func (mock *MoqExpecter) Variadic(ints ...int) error { callInfo := struct { Ints []int }{ Ints: ints, } mock.lockVariadic.Lock() mock.calls.Variadic = append(mock.calls.Variadic, callInfo) mock.lockVariadic.Unlock() if mock.VariadicFunc == nil { var ( err error ) return err } return mock.VariadicFunc(ints...) } // VariadicCalls gets all the calls that were made to Variadic. // Check the length with: // // len(mockedExpecter.VariadicCalls()) func (mock *MoqExpecter) VariadicCalls() []struct { Ints []int } { var calls []struct { Ints []int } mock.lockVariadic.RLock() calls = mock.calls.Variadic mock.lockVariadic.RUnlock() return calls } // ResetVariadicCalls reset all the calls that were made to Variadic. func (mock *MoqExpecter) ResetVariadicCalls() { mock.lockVariadic.Lock() mock.calls.Variadic = nil mock.lockVariadic.Unlock() } // VariadicMany calls VariadicManyFunc. func (mock *MoqExpecter) VariadicMany(i int, a string, intfs ...interface{}) error { callInfo := struct { I int A string Intfs []interface{} }{ I: i, A: a, Intfs: intfs, } mock.lockVariadicMany.Lock() mock.calls.VariadicMany = append(mock.calls.VariadicMany, callInfo) mock.lockVariadicMany.Unlock() if mock.VariadicManyFunc == nil { var ( err error ) return err } return mock.VariadicManyFunc(i, a, intfs...) } // VariadicManyCalls gets all the calls that were made to VariadicMany. // Check the length with: // // len(mockedExpecter.VariadicManyCalls()) func (mock *MoqExpecter) VariadicManyCalls() []struct { I int A string Intfs []interface{} } { var calls []struct { I int A string Intfs []interface{} } mock.lockVariadicMany.RLock() calls = mock.calls.VariadicMany mock.lockVariadicMany.RUnlock() return calls } // ResetVariadicManyCalls reset all the calls that were made to VariadicMany. func (mock *MoqExpecter) ResetVariadicManyCalls() { mock.lockVariadicMany.Lock() mock.calls.VariadicMany = nil mock.lockVariadicMany.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqExpecter) ResetCalls() { mock.lockManyArgsReturns.Lock() mock.calls.ManyArgsReturns = nil mock.lockManyArgsReturns.Unlock() mock.lockNoArg.Lock() mock.calls.NoArg = nil mock.lockNoArg.Unlock() mock.lockNoReturn.Lock() mock.calls.NoReturn = nil mock.lockNoReturn.Unlock() mock.lockVariadic.Lock() mock.calls.Variadic = nil mock.lockVariadic.Unlock() mock.lockVariadicMany.Lock() mock.calls.VariadicMany = nil mock.lockVariadicMany.Unlock() } // Ensure that MoqVariadicNoReturnInterface does implement VariadicNoReturnInterface. // If this is not the case, regenerate this file with mockery. var _ VariadicNoReturnInterface = &MoqVariadicNoReturnInterface{} // MoqVariadicNoReturnInterface is a mock implementation of VariadicNoReturnInterface. // // func TestSomethingThatUsesVariadicNoReturnInterface(t *testing.T) { // // // make and configure a mocked VariadicNoReturnInterface // mockedVariadicNoReturnInterface := &MoqVariadicNoReturnInterface{ // VariadicNoReturnFunc: func(j int, is ...interface{}) { // panic("mock out the VariadicNoReturn method") // }, // } // // // use mockedVariadicNoReturnInterface in code that requires VariadicNoReturnInterface // // and then make assertions. // // } type MoqVariadicNoReturnInterface struct { // VariadicNoReturnFunc mocks the VariadicNoReturn method. VariadicNoReturnFunc func(j int, is ...interface{}) // calls tracks calls to the methods. calls struct { // VariadicNoReturn holds details about calls to the VariadicNoReturn method. VariadicNoReturn []struct { // J is the j argument value. J int // Is is the is argument value. Is []interface{} } } lockVariadicNoReturn sync.RWMutex } // VariadicNoReturn calls VariadicNoReturnFunc. func (mock *MoqVariadicNoReturnInterface) VariadicNoReturn(j int, is ...interface{}) { callInfo := struct { J int Is []interface{} }{ J: j, Is: is, } mock.lockVariadicNoReturn.Lock() mock.calls.VariadicNoReturn = append(mock.calls.VariadicNoReturn, callInfo) mock.lockVariadicNoReturn.Unlock() if mock.VariadicNoReturnFunc == nil { return } mock.VariadicNoReturnFunc(j, is...) } // VariadicNoReturnCalls gets all the calls that were made to VariadicNoReturn. // Check the length with: // // len(mockedVariadicNoReturnInterface.VariadicNoReturnCalls()) func (mock *MoqVariadicNoReturnInterface) VariadicNoReturnCalls() []struct { J int Is []interface{} } { var calls []struct { J int Is []interface{} } mock.lockVariadicNoReturn.RLock() calls = mock.calls.VariadicNoReturn mock.lockVariadicNoReturn.RUnlock() return calls } // ResetVariadicNoReturnCalls reset all the calls that were made to VariadicNoReturn. func (mock *MoqVariadicNoReturnInterface) ResetVariadicNoReturnCalls() { mock.lockVariadicNoReturn.Lock() mock.calls.VariadicNoReturn = nil mock.lockVariadicNoReturn.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqVariadicNoReturnInterface) ResetCalls() { mock.lockVariadicNoReturn.Lock() mock.calls.VariadicNoReturn = nil mock.lockVariadicNoReturn.Unlock() } // Ensure that MoqFuncArgsCollision does implement FuncArgsCollision. // If this is not the case, regenerate this file with mockery. var _ FuncArgsCollision = &MoqFuncArgsCollision{} // MoqFuncArgsCollision is a mock implementation of FuncArgsCollision. // // func TestSomethingThatUsesFuncArgsCollision(t *testing.T) { // // // make and configure a mocked FuncArgsCollision // mockedFuncArgsCollision := &MoqFuncArgsCollision{ // FooFunc: func(ret interface{}) error { // panic("mock out the Foo method") // }, // } // // // use mockedFuncArgsCollision in code that requires FuncArgsCollision // // and then make assertions. // // } type MoqFuncArgsCollision struct { // FooFunc mocks the Foo method. FooFunc func(ret interface{}) error // calls tracks calls to the methods. calls struct { // Foo holds details about calls to the Foo method. Foo []struct { // Ret is the ret argument value. Ret interface{} } } lockFoo sync.RWMutex } // Foo calls FooFunc. func (mock *MoqFuncArgsCollision) Foo(ret interface{}) error { callInfo := struct { Ret interface{} }{ Ret: ret, } mock.lockFoo.Lock() mock.calls.Foo = append(mock.calls.Foo, callInfo) mock.lockFoo.Unlock() if mock.FooFunc == nil { var ( err error ) return err } return mock.FooFunc(ret) } // FooCalls gets all the calls that were made to Foo. // Check the length with: // // len(mockedFuncArgsCollision.FooCalls()) func (mock *MoqFuncArgsCollision) FooCalls() []struct { Ret interface{} } { var calls []struct { Ret interface{} } mock.lockFoo.RLock() calls = mock.calls.Foo mock.lockFoo.RUnlock() return calls } // ResetFooCalls reset all the calls that were made to Foo. func (mock *MoqFuncArgsCollision) ResetFooCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqFuncArgsCollision) ResetCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // Ensure that MoqGetInt does implement GetInt. // If this is not the case, regenerate this file with mockery. var _ GetInt = &MoqGetInt{} // MoqGetInt is a mock implementation of GetInt. // // func TestSomethingThatUsesGetInt(t *testing.T) { // // // make and configure a mocked GetInt // mockedGetInt := &MoqGetInt{ // GetFunc: func() int { // panic("mock out the Get method") // }, // } // // // use mockedGetInt in code that requires GetInt // // and then make assertions. // // } type MoqGetInt struct { // GetFunc mocks the Get method. GetFunc func() int // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqGetInt) Get() int { callInfo := struct { }{} mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( n int ) return n } return mock.GetFunc() } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedGetInt.GetCalls()) func (mock *MoqGetInt) GetCalls() []struct { } { var calls []struct { } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqGetInt) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqGetInt) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqGetGeneric does implement GetGeneric. // If this is not the case, regenerate this file with mockery. var _ GetGeneric[int] = &MoqGetGeneric[int]{} // MoqGetGeneric is a mock implementation of GetGeneric. // // func TestSomethingThatUsesGetGeneric(t *testing.T) { // // // make and configure a mocked GetGeneric // mockedGetGeneric := &MoqGetGeneric{ // GetFunc: func() T { // panic("mock out the Get method") // }, // } // // // use mockedGetGeneric in code that requires GetGeneric // // and then make assertions. // // } type MoqGetGeneric[T constraints.Integer] struct { // GetFunc mocks the Get method. GetFunc func() T // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqGetGeneric[T]) Get() T { callInfo := struct { }{} mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( v T ) return v } return mock.GetFunc() } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedGetGeneric.GetCalls()) func (mock *MoqGetGeneric[T]) GetCalls() []struct { } { var calls []struct { } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqGetGeneric[T]) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqGetGeneric[T]) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqEmbeddedGet does implement EmbeddedGet. // If this is not the case, regenerate this file with mockery. var _ EmbeddedGet[int] = &MoqEmbeddedGet[int]{} // MoqEmbeddedGet is a mock implementation of EmbeddedGet. // // func TestSomethingThatUsesEmbeddedGet(t *testing.T) { // // // make and configure a mocked EmbeddedGet // mockedEmbeddedGet := &MoqEmbeddedGet{ // GetFunc: func() T { // panic("mock out the Get method") // }, // } // // // use mockedEmbeddedGet in code that requires EmbeddedGet // // and then make assertions. // // } type MoqEmbeddedGet[T constraints.Signed] struct { // GetFunc mocks the Get method. GetFunc func() T // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqEmbeddedGet[T]) Get() T { callInfo := struct { }{} mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( v T ) return v } return mock.GetFunc() } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedEmbeddedGet.GetCalls()) func (mock *MoqEmbeddedGet[T]) GetCalls() []struct { } { var calls []struct { } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqEmbeddedGet[T]) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqEmbeddedGet[T]) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqReplaceGeneric does implement ReplaceGeneric. // If this is not the case, regenerate this file with mockery. var _ ReplaceGeneric[any, int, any] = &MoqReplaceGeneric[any, int, any]{} // MoqReplaceGeneric is a mock implementation of ReplaceGeneric. // // func TestSomethingThatUsesReplaceGeneric(t *testing.T) { // // // make and configure a mocked ReplaceGeneric // mockedReplaceGeneric := &MoqReplaceGeneric{ // AFunc: func(t1 TImport) TKeep { // panic("mock out the A method") // }, // BFunc: func() TImport { // panic("mock out the B method") // }, // CFunc: func() TConstraint { // panic("mock out the C method") // }, // } // // // use mockedReplaceGeneric in code that requires ReplaceGeneric // // and then make assertions. // // } type MoqReplaceGeneric[TImport any, TConstraint constraints.Signed, TKeep any] struct { // AFunc mocks the A method. AFunc func(t1 TImport) TKeep // BFunc mocks the B method. BFunc func() TImport // CFunc mocks the C method. CFunc func() TConstraint // calls tracks calls to the methods. calls struct { // A holds details about calls to the A method. A []struct { // T1 is the t1 argument value. T1 TImport } // B holds details about calls to the B method. B []struct { } // C holds details about calls to the C method. C []struct { } } lockA sync.RWMutex lockB sync.RWMutex lockC sync.RWMutex } // A calls AFunc. func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) A(t1 TImport) TKeep { callInfo := struct { T1 TImport }{ T1: t1, } mock.lockA.Lock() mock.calls.A = append(mock.calls.A, callInfo) mock.lockA.Unlock() if mock.AFunc == nil { var ( v TKeep ) return v } return mock.AFunc(t1) } // ACalls gets all the calls that were made to A. // Check the length with: // // len(mockedReplaceGeneric.ACalls()) func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) ACalls() []struct { T1 TImport } { var calls []struct { T1 TImport } mock.lockA.RLock() calls = mock.calls.A mock.lockA.RUnlock() return calls } // ResetACalls reset all the calls that were made to A. func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) ResetACalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() } // B calls BFunc. func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) B() TImport { callInfo := struct { }{} mock.lockB.Lock() mock.calls.B = append(mock.calls.B, callInfo) mock.lockB.Unlock() if mock.BFunc == nil { var ( v TImport ) return v } return mock.BFunc() } // BCalls gets all the calls that were made to B. // Check the length with: // // len(mockedReplaceGeneric.BCalls()) func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) BCalls() []struct { } { var calls []struct { } mock.lockB.RLock() calls = mock.calls.B mock.lockB.RUnlock() return calls } // ResetBCalls reset all the calls that were made to B. func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) ResetBCalls() { mock.lockB.Lock() mock.calls.B = nil mock.lockB.Unlock() } // C calls CFunc. func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) C() TConstraint { callInfo := struct { }{} mock.lockC.Lock() mock.calls.C = append(mock.calls.C, callInfo) mock.lockC.Unlock() if mock.CFunc == nil { var ( v TConstraint ) return v } return mock.CFunc() } // CCalls gets all the calls that were made to C. // Check the length with: // // len(mockedReplaceGeneric.CCalls()) func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) CCalls() []struct { } { var calls []struct { } mock.lockC.RLock() calls = mock.calls.C mock.lockC.RUnlock() return calls } // ResetCCalls reset all the calls that were made to C. func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) ResetCCalls() { mock.lockC.Lock() mock.calls.C = nil mock.lockC.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqReplaceGeneric[TImport, TConstraint, TKeep]) ResetCalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() mock.lockB.Lock() mock.calls.B = nil mock.lockB.Unlock() mock.lockC.Lock() mock.calls.C = nil mock.lockC.Unlock() } // Ensure that MoqReplaceGenericSelf does implement ReplaceGenericSelf. // If this is not the case, regenerate this file with mockery. var _ ReplaceGenericSelf[any] = &MoqReplaceGenericSelf[any]{} // MoqReplaceGenericSelf is a mock implementation of ReplaceGenericSelf. // // func TestSomethingThatUsesReplaceGenericSelf(t *testing.T) { // // // make and configure a mocked ReplaceGenericSelf // mockedReplaceGenericSelf := &MoqReplaceGenericSelf{ // AFunc: func() T { // panic("mock out the A method") // }, // } // // // use mockedReplaceGenericSelf in code that requires ReplaceGenericSelf // // and then make assertions. // // } type MoqReplaceGenericSelf[T any] struct { // AFunc mocks the A method. AFunc func() T // calls tracks calls to the methods. calls struct { // A holds details about calls to the A method. A []struct { } } lockA sync.RWMutex } // A calls AFunc. func (mock *MoqReplaceGenericSelf[T]) A() T { callInfo := struct { }{} mock.lockA.Lock() mock.calls.A = append(mock.calls.A, callInfo) mock.lockA.Unlock() if mock.AFunc == nil { var ( v T ) return v } return mock.AFunc() } // ACalls gets all the calls that were made to A. // Check the length with: // // len(mockedReplaceGenericSelf.ACalls()) func (mock *MoqReplaceGenericSelf[T]) ACalls() []struct { } { var calls []struct { } mock.lockA.RLock() calls = mock.calls.A mock.lockA.RUnlock() return calls } // ResetACalls reset all the calls that were made to A. func (mock *MoqReplaceGenericSelf[T]) ResetACalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqReplaceGenericSelf[T]) ResetCalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() } // Ensure that MoqHasConflictingNestedImports does implement HasConflictingNestedImports. // If this is not the case, regenerate this file with mockery. var _ HasConflictingNestedImports = &MoqHasConflictingNestedImports{} // MoqHasConflictingNestedImports is a mock implementation of HasConflictingNestedImports. // // func TestSomethingThatUsesHasConflictingNestedImports(t *testing.T) { // // // make and configure a mocked HasConflictingNestedImports // mockedHasConflictingNestedImports := &MoqHasConflictingNestedImports{ // GetFunc: func(path string) (http.Response, error) { // panic("mock out the Get method") // }, // ZFunc: func() http0.MyStruct { // panic("mock out the Z method") // }, // } // // // use mockedHasConflictingNestedImports in code that requires HasConflictingNestedImports // // and then make assertions. // // } type MoqHasConflictingNestedImports struct { // GetFunc mocks the Get method. GetFunc func(path string) (http.Response, error) // ZFunc mocks the Z method. ZFunc func() http0.MyStruct // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } // Z holds details about calls to the Z method. Z []struct { } } lockGet sync.RWMutex lockZ sync.RWMutex } // Get calls GetFunc. func (mock *MoqHasConflictingNestedImports) Get(path string) (http.Response, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( response http.Response err error ) return response, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedHasConflictingNestedImports.GetCalls()) func (mock *MoqHasConflictingNestedImports) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqHasConflictingNestedImports) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Z calls ZFunc. func (mock *MoqHasConflictingNestedImports) Z() http0.MyStruct { callInfo := struct { }{} mock.lockZ.Lock() mock.calls.Z = append(mock.calls.Z, callInfo) mock.lockZ.Unlock() if mock.ZFunc == nil { var ( myStruct http0.MyStruct ) return myStruct } return mock.ZFunc() } // ZCalls gets all the calls that were made to Z. // Check the length with: // // len(mockedHasConflictingNestedImports.ZCalls()) func (mock *MoqHasConflictingNestedImports) ZCalls() []struct { } { var calls []struct { } mock.lockZ.RLock() calls = mock.calls.Z mock.lockZ.RUnlock() return calls } // ResetZCalls reset all the calls that were made to Z. func (mock *MoqHasConflictingNestedImports) ResetZCalls() { mock.lockZ.Lock() mock.calls.Z = nil mock.lockZ.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqHasConflictingNestedImports) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() mock.lockZ.Lock() mock.calls.Z = nil mock.lockZ.Unlock() } // Ensure that MoqImportsSameAsPackage does implement ImportsSameAsPackage. // If this is not the case, regenerate this file with mockery. var _ ImportsSameAsPackage = &MoqImportsSameAsPackage{} // MoqImportsSameAsPackage is a mock implementation of ImportsSameAsPackage. // // func TestSomethingThatUsesImportsSameAsPackage(t *testing.T) { // // // make and configure a mocked ImportsSameAsPackage // mockedImportsSameAsPackage := &MoqImportsSameAsPackage{ // AFunc: func() test.B { // panic("mock out the A method") // }, // BFunc: func() KeyManager { // panic("mock out the B method") // }, // CFunc: func(c C) { // panic("mock out the C method") // }, // } // // // use mockedImportsSameAsPackage in code that requires ImportsSameAsPackage // // and then make assertions. // // } type MoqImportsSameAsPackage struct { // AFunc mocks the A method. AFunc func() test.B // BFunc mocks the B method. BFunc func() KeyManager // CFunc mocks the C method. CFunc func(c C) // calls tracks calls to the methods. calls struct { // A holds details about calls to the A method. A []struct { } // B holds details about calls to the B method. B []struct { } // C holds details about calls to the C method. C []struct { // C is the c argument value. C C } } lockA sync.RWMutex lockB sync.RWMutex lockC sync.RWMutex } // A calls AFunc. func (mock *MoqImportsSameAsPackage) A() test.B { callInfo := struct { }{} mock.lockA.Lock() mock.calls.A = append(mock.calls.A, callInfo) mock.lockA.Unlock() if mock.AFunc == nil { var ( b test.B ) return b } return mock.AFunc() } // ACalls gets all the calls that were made to A. // Check the length with: // // len(mockedImportsSameAsPackage.ACalls()) func (mock *MoqImportsSameAsPackage) ACalls() []struct { } { var calls []struct { } mock.lockA.RLock() calls = mock.calls.A mock.lockA.RUnlock() return calls } // ResetACalls reset all the calls that were made to A. func (mock *MoqImportsSameAsPackage) ResetACalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() } // B calls BFunc. func (mock *MoqImportsSameAsPackage) B() KeyManager { callInfo := struct { }{} mock.lockB.Lock() mock.calls.B = append(mock.calls.B, callInfo) mock.lockB.Unlock() if mock.BFunc == nil { var ( keyManager KeyManager ) return keyManager } return mock.BFunc() } // BCalls gets all the calls that were made to B. // Check the length with: // // len(mockedImportsSameAsPackage.BCalls()) func (mock *MoqImportsSameAsPackage) BCalls() []struct { } { var calls []struct { } mock.lockB.RLock() calls = mock.calls.B mock.lockB.RUnlock() return calls } // ResetBCalls reset all the calls that were made to B. func (mock *MoqImportsSameAsPackage) ResetBCalls() { mock.lockB.Lock() mock.calls.B = nil mock.lockB.Unlock() } // C calls CFunc. func (mock *MoqImportsSameAsPackage) C(c C) { callInfo := struct { C C }{ C: c, } mock.lockC.Lock() mock.calls.C = append(mock.calls.C, callInfo) mock.lockC.Unlock() if mock.CFunc == nil { return } mock.CFunc(c) } // CCalls gets all the calls that were made to C. // Check the length with: // // len(mockedImportsSameAsPackage.CCalls()) func (mock *MoqImportsSameAsPackage) CCalls() []struct { C C } { var calls []struct { C C } mock.lockC.RLock() calls = mock.calls.C mock.lockC.RUnlock() return calls } // ResetCCalls reset all the calls that were made to C. func (mock *MoqImportsSameAsPackage) ResetCCalls() { mock.lockC.Lock() mock.calls.C = nil mock.lockC.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqImportsSameAsPackage) ResetCalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() mock.lockB.Lock() mock.calls.B = nil mock.lockB.Unlock() mock.lockC.Lock() mock.calls.C = nil mock.lockC.Unlock() } // Ensure that MoqGenericInterface does implement GenericInterface. // If this is not the case, regenerate this file with mockery. var _ GenericInterface[any] = &MoqGenericInterface[any]{} // MoqGenericInterface is a mock implementation of GenericInterface. // // func TestSomethingThatUsesGenericInterface(t *testing.T) { // // // make and configure a mocked GenericInterface // mockedGenericInterface := &MoqGenericInterface{ // FuncFunc: func(arg *M) int { // panic("mock out the Func method") // }, // } // // // use mockedGenericInterface in code that requires GenericInterface // // and then make assertions. // // } type MoqGenericInterface[M any] struct { // FuncFunc mocks the Func method. FuncFunc func(arg *M) int // calls tracks calls to the methods. calls struct { // Func holds details about calls to the Func method. Func []struct { // Arg is the arg argument value. Arg *M } } lockFunc sync.RWMutex } // Func calls FuncFunc. func (mock *MoqGenericInterface[M]) Func(arg *M) int { callInfo := struct { Arg *M }{ Arg: arg, } mock.lockFunc.Lock() mock.calls.Func = append(mock.calls.Func, callInfo) mock.lockFunc.Unlock() if mock.FuncFunc == nil { var ( n int ) return n } return mock.FuncFunc(arg) } // FuncCalls gets all the calls that were made to Func. // Check the length with: // // len(mockedGenericInterface.FuncCalls()) func (mock *MoqGenericInterface[M]) FuncCalls() []struct { Arg *M } { var calls []struct { Arg *M } mock.lockFunc.RLock() calls = mock.calls.Func mock.lockFunc.RUnlock() return calls } // ResetFuncCalls reset all the calls that were made to Func. func (mock *MoqGenericInterface[M]) ResetFuncCalls() { mock.lockFunc.Lock() mock.calls.Func = nil mock.lockFunc.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqGenericInterface[M]) ResetCalls() { mock.lockFunc.Lock() mock.calls.Func = nil mock.lockFunc.Unlock() } // Ensure that MoqInstantiatedGenericInterface does implement InstantiatedGenericInterface. // If this is not the case, regenerate this file with mockery. var _ InstantiatedGenericInterface = &MoqInstantiatedGenericInterface{} // MoqInstantiatedGenericInterface is a mock implementation of InstantiatedGenericInterface. // // func TestSomethingThatUsesInstantiatedGenericInterface(t *testing.T) { // // // make and configure a mocked InstantiatedGenericInterface // mockedInstantiatedGenericInterface := &MoqInstantiatedGenericInterface{ // FuncFunc: func(arg *float32) int { // panic("mock out the Func method") // }, // } // // // use mockedInstantiatedGenericInterface in code that requires InstantiatedGenericInterface // // and then make assertions. // // } type MoqInstantiatedGenericInterface struct { // FuncFunc mocks the Func method. FuncFunc func(arg *float32) int // calls tracks calls to the methods. calls struct { // Func holds details about calls to the Func method. Func []struct { // Arg is the arg argument value. Arg *float32 } } lockFunc sync.RWMutex } // Func calls FuncFunc. func (mock *MoqInstantiatedGenericInterface) Func(arg *float32) int { callInfo := struct { Arg *float32 }{ Arg: arg, } mock.lockFunc.Lock() mock.calls.Func = append(mock.calls.Func, callInfo) mock.lockFunc.Unlock() if mock.FuncFunc == nil { var ( n int ) return n } return mock.FuncFunc(arg) } // FuncCalls gets all the calls that were made to Func. // Check the length with: // // len(mockedInstantiatedGenericInterface.FuncCalls()) func (mock *MoqInstantiatedGenericInterface) FuncCalls() []struct { Arg *float32 } { var calls []struct { Arg *float32 } mock.lockFunc.RLock() calls = mock.calls.Func mock.lockFunc.RUnlock() return calls } // ResetFuncCalls reset all the calls that were made to Func. func (mock *MoqInstantiatedGenericInterface) ResetFuncCalls() { mock.lockFunc.Lock() mock.calls.Func = nil mock.lockFunc.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqInstantiatedGenericInterface) ResetCalls() { mock.lockFunc.Lock() mock.calls.Func = nil mock.lockFunc.Unlock() } // Ensure that MoqMyReader does implement MyReader. // If this is not the case, regenerate this file with mockery. var _ MyReader = &MoqMyReader{} // MoqMyReader is a mock implementation of MyReader. // // func TestSomethingThatUsesMyReader(t *testing.T) { // // // make and configure a mocked MyReader // mockedMyReader := &MoqMyReader{ // ReadFunc: func(p []byte) (int, error) { // panic("mock out the Read method") // }, // } // // // use mockedMyReader in code that requires MyReader // // and then make assertions. // // } type MoqMyReader struct { // ReadFunc mocks the Read method. ReadFunc func(p []byte) (int, error) // calls tracks calls to the methods. calls struct { // Read holds details about calls to the Read method. Read []struct { // P is the p argument value. P []byte } } lockRead sync.RWMutex } // Read calls ReadFunc. func (mock *MoqMyReader) Read(p []byte) (int, error) { callInfo := struct { P []byte }{ P: p, } mock.lockRead.Lock() mock.calls.Read = append(mock.calls.Read, callInfo) mock.lockRead.Unlock() if mock.ReadFunc == nil { var ( n int err error ) return n, err } return mock.ReadFunc(p) } // ReadCalls gets all the calls that were made to Read. // Check the length with: // // len(mockedMyReader.ReadCalls()) func (mock *MoqMyReader) ReadCalls() []struct { P []byte } { var calls []struct { P []byte } mock.lockRead.RLock() calls = mock.calls.Read mock.lockRead.RUnlock() return calls } // ResetReadCalls reset all the calls that were made to Read. func (mock *MoqMyReader) ResetReadCalls() { mock.lockRead.Lock() mock.calls.Read = nil mock.lockRead.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqMyReader) ResetCalls() { mock.lockRead.Lock() mock.calls.Read = nil mock.lockRead.Unlock() } // Ensure that MoqIssue766 does implement Issue766. // If this is not the case, regenerate this file with mockery. var _ Issue766 = &MoqIssue766{} // MoqIssue766 is a mock implementation of Issue766. // // func TestSomethingThatUsesIssue766(t *testing.T) { // // // make and configure a mocked Issue766 // mockedIssue766 := &MoqIssue766{ // FetchDataFunc: func(fetchFunc func(x ...int) ([]int, error)) ([]int, error) { // panic("mock out the FetchData method") // }, // } // // // use mockedIssue766 in code that requires Issue766 // // and then make assertions. // // } type MoqIssue766 struct { // FetchDataFunc mocks the FetchData method. FetchDataFunc func(fetchFunc func(x ...int) ([]int, error)) ([]int, error) // calls tracks calls to the methods. calls struct { // FetchData holds details about calls to the FetchData method. FetchData []struct { // FetchFunc is the fetchFunc argument value. FetchFunc func(x ...int) ([]int, error) } } lockFetchData sync.RWMutex } // FetchData calls FetchDataFunc. func (mock *MoqIssue766) FetchData(fetchFunc func(x ...int) ([]int, error)) ([]int, error) { callInfo := struct { FetchFunc func(x ...int) ([]int, error) }{ FetchFunc: fetchFunc, } mock.lockFetchData.Lock() mock.calls.FetchData = append(mock.calls.FetchData, callInfo) mock.lockFetchData.Unlock() if mock.FetchDataFunc == nil { var ( ints []int err error ) return ints, err } return mock.FetchDataFunc(fetchFunc) } // FetchDataCalls gets all the calls that were made to FetchData. // Check the length with: // // len(mockedIssue766.FetchDataCalls()) func (mock *MoqIssue766) FetchDataCalls() []struct { FetchFunc func(x ...int) ([]int, error) } { var calls []struct { FetchFunc func(x ...int) ([]int, error) } mock.lockFetchData.RLock() calls = mock.calls.FetchData mock.lockFetchData.RUnlock() return calls } // ResetFetchDataCalls reset all the calls that were made to FetchData. func (mock *MoqIssue766) ResetFetchDataCalls() { mock.lockFetchData.Lock() mock.calls.FetchData = nil mock.lockFetchData.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqIssue766) ResetCalls() { mock.lockFetchData.Lock() mock.calls.FetchData = nil mock.lockFetchData.Unlock() } // Ensure that MoqMapToInterface does implement MapToInterface. // If this is not the case, regenerate this file with mockery. var _ MapToInterface = &MoqMapToInterface{} // MoqMapToInterface is a mock implementation of MapToInterface. // // func TestSomethingThatUsesMapToInterface(t *testing.T) { // // // make and configure a mocked MapToInterface // mockedMapToInterface := &MoqMapToInterface{ // FooFunc: func(arg1 ...map[string]interface{}) { // panic("mock out the Foo method") // }, // } // // // use mockedMapToInterface in code that requires MapToInterface // // and then make assertions. // // } type MoqMapToInterface struct { // FooFunc mocks the Foo method. FooFunc func(arg1 ...map[string]interface{}) // calls tracks calls to the methods. calls struct { // Foo holds details about calls to the Foo method. Foo []struct { // Arg1 is the arg1 argument value. Arg1 []map[string]interface{} } } lockFoo sync.RWMutex } // Foo calls FooFunc. func (mock *MoqMapToInterface) Foo(arg1 ...map[string]interface{}) { callInfo := struct { Arg1 []map[string]interface{} }{ Arg1: arg1, } mock.lockFoo.Lock() mock.calls.Foo = append(mock.calls.Foo, callInfo) mock.lockFoo.Unlock() if mock.FooFunc == nil { return } mock.FooFunc(arg1...) } // FooCalls gets all the calls that were made to Foo. // Check the length with: // // len(mockedMapToInterface.FooCalls()) func (mock *MoqMapToInterface) FooCalls() []struct { Arg1 []map[string]interface{} } { var calls []struct { Arg1 []map[string]interface{} } mock.lockFoo.RLock() calls = mock.calls.Foo mock.lockFoo.RUnlock() return calls } // ResetFooCalls reset all the calls that were made to Foo. func (mock *MoqMapToInterface) ResetFooCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqMapToInterface) ResetCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // Ensure that MoqSibling does implement Sibling. // If this is not the case, regenerate this file with mockery. var _ Sibling = &MoqSibling{} // MoqSibling is a mock implementation of Sibling. // // func TestSomethingThatUsesSibling(t *testing.T) { // // // make and configure a mocked Sibling // mockedSibling := &MoqSibling{ // DoSomethingFunc: func() { // panic("mock out the DoSomething method") // }, // } // // // use mockedSibling in code that requires Sibling // // and then make assertions. // // } type MoqSibling struct { // DoSomethingFunc mocks the DoSomething method. DoSomethingFunc func() // calls tracks calls to the methods. calls struct { // DoSomething holds details about calls to the DoSomething method. DoSomething []struct { } } lockDoSomething sync.RWMutex } // DoSomething calls DoSomethingFunc. func (mock *MoqSibling) DoSomething() { callInfo := struct { }{} mock.lockDoSomething.Lock() mock.calls.DoSomething = append(mock.calls.DoSomething, callInfo) mock.lockDoSomething.Unlock() if mock.DoSomethingFunc == nil { return } mock.DoSomethingFunc() } // DoSomethingCalls gets all the calls that were made to DoSomething. // Check the length with: // // len(mockedSibling.DoSomethingCalls()) func (mock *MoqSibling) DoSomethingCalls() []struct { } { var calls []struct { } mock.lockDoSomething.RLock() calls = mock.calls.DoSomething mock.lockDoSomething.RUnlock() return calls } // ResetDoSomethingCalls reset all the calls that were made to DoSomething. func (mock *MoqSibling) ResetDoSomethingCalls() { mock.lockDoSomething.Lock() mock.calls.DoSomething = nil mock.lockDoSomething.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqSibling) ResetCalls() { mock.lockDoSomething.Lock() mock.calls.DoSomething = nil mock.lockDoSomething.Unlock() } // Ensure that MoqUsesOtherPkgIface does implement UsesOtherPkgIface. // If this is not the case, regenerate this file with mockery. var _ UsesOtherPkgIface = &MoqUsesOtherPkgIface{} // MoqUsesOtherPkgIface is a mock implementation of UsesOtherPkgIface. // // func TestSomethingThatUsesUsesOtherPkgIface(t *testing.T) { // // // make and configure a mocked UsesOtherPkgIface // mockedUsesOtherPkgIface := &MoqUsesOtherPkgIface{ // DoSomethingElseFunc: func(obj Sibling) { // panic("mock out the DoSomethingElse method") // }, // } // // // use mockedUsesOtherPkgIface in code that requires UsesOtherPkgIface // // and then make assertions. // // } type MoqUsesOtherPkgIface struct { // DoSomethingElseFunc mocks the DoSomethingElse method. DoSomethingElseFunc func(obj Sibling) // calls tracks calls to the methods. calls struct { // DoSomethingElse holds details about calls to the DoSomethingElse method. DoSomethingElse []struct { // Obj is the obj argument value. Obj Sibling } } lockDoSomethingElse sync.RWMutex } // DoSomethingElse calls DoSomethingElseFunc. func (mock *MoqUsesOtherPkgIface) DoSomethingElse(obj Sibling) { callInfo := struct { Obj Sibling }{ Obj: obj, } mock.lockDoSomethingElse.Lock() mock.calls.DoSomethingElse = append(mock.calls.DoSomethingElse, callInfo) mock.lockDoSomethingElse.Unlock() if mock.DoSomethingElseFunc == nil { return } mock.DoSomethingElseFunc(obj) } // DoSomethingElseCalls gets all the calls that were made to DoSomethingElse. // Check the length with: // // len(mockedUsesOtherPkgIface.DoSomethingElseCalls()) func (mock *MoqUsesOtherPkgIface) DoSomethingElseCalls() []struct { Obj Sibling } { var calls []struct { Obj Sibling } mock.lockDoSomethingElse.RLock() calls = mock.calls.DoSomethingElse mock.lockDoSomethingElse.RUnlock() return calls } // ResetDoSomethingElseCalls reset all the calls that were made to DoSomethingElse. func (mock *MoqUsesOtherPkgIface) ResetDoSomethingElseCalls() { mock.lockDoSomethingElse.Lock() mock.calls.DoSomethingElse = nil mock.lockDoSomethingElse.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqUsesOtherPkgIface) ResetCalls() { mock.lockDoSomethingElse.Lock() mock.calls.DoSomethingElse = nil mock.lockDoSomethingElse.Unlock() } // Ensure that MoqNilRun does implement NilRun. // If this is not the case, regenerate this file with mockery. var _ NilRun = &MoqNilRun{} // MoqNilRun is a mock implementation of NilRun. // // func TestSomethingThatUsesNilRun(t *testing.T) { // // // make and configure a mocked NilRun // mockedNilRun := &MoqNilRun{ // FooFunc: func(nilRun NilRun) { // panic("mock out the Foo method") // }, // } // // // use mockedNilRun in code that requires NilRun // // and then make assertions. // // } type MoqNilRun struct { // FooFunc mocks the Foo method. FooFunc func(nilRun NilRun) // calls tracks calls to the methods. calls struct { // Foo holds details about calls to the Foo method. Foo []struct { // NilRun is the nilRun argument value. NilRun NilRun } } lockFoo sync.RWMutex } // Foo calls FooFunc. func (mock *MoqNilRun) Foo(nilRun NilRun) { callInfo := struct { NilRun NilRun }{ NilRun: nilRun, } mock.lockFoo.Lock() mock.calls.Foo = append(mock.calls.Foo, callInfo) mock.lockFoo.Unlock() if mock.FooFunc == nil { return } mock.FooFunc(nilRun) } // FooCalls gets all the calls that were made to Foo. // Check the length with: // // len(mockedNilRun.FooCalls()) func (mock *MoqNilRun) FooCalls() []struct { NilRun NilRun } { var calls []struct { NilRun NilRun } mock.lockFoo.RLock() calls = mock.calls.Foo mock.lockFoo.RUnlock() return calls } // ResetFooCalls reset all the calls that were made to Foo. func (mock *MoqNilRun) ResetFooCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqNilRun) ResetCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // Ensure that MoqPanicOnNoReturnValue does implement PanicOnNoReturnValue. // If this is not the case, regenerate this file with mockery. var _ PanicOnNoReturnValue = &MoqPanicOnNoReturnValue{} // MoqPanicOnNoReturnValue is a mock implementation of PanicOnNoReturnValue. // // func TestSomethingThatUsesPanicOnNoReturnValue(t *testing.T) { // // // make and configure a mocked PanicOnNoReturnValue // mockedPanicOnNoReturnValue := &MoqPanicOnNoReturnValue{ // DoSomethingFunc: func() string { // panic("mock out the DoSomething method") // }, // } // // // use mockedPanicOnNoReturnValue in code that requires PanicOnNoReturnValue // // and then make assertions. // // } type MoqPanicOnNoReturnValue struct { // DoSomethingFunc mocks the DoSomething method. DoSomethingFunc func() string // calls tracks calls to the methods. calls struct { // DoSomething holds details about calls to the DoSomething method. DoSomething []struct { } } lockDoSomething sync.RWMutex } // DoSomething calls DoSomethingFunc. func (mock *MoqPanicOnNoReturnValue) DoSomething() string { callInfo := struct { }{} mock.lockDoSomething.Lock() mock.calls.DoSomething = append(mock.calls.DoSomething, callInfo) mock.lockDoSomething.Unlock() if mock.DoSomethingFunc == nil { var ( s string ) return s } return mock.DoSomethingFunc() } // DoSomethingCalls gets all the calls that were made to DoSomething. // Check the length with: // // len(mockedPanicOnNoReturnValue.DoSomethingCalls()) func (mock *MoqPanicOnNoReturnValue) DoSomethingCalls() []struct { } { var calls []struct { } mock.lockDoSomething.RLock() calls = mock.calls.DoSomething mock.lockDoSomething.RUnlock() return calls } // ResetDoSomethingCalls reset all the calls that were made to DoSomething. func (mock *MoqPanicOnNoReturnValue) ResetDoSomethingCalls() { mock.lockDoSomething.Lock() mock.calls.DoSomething = nil mock.lockDoSomething.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqPanicOnNoReturnValue) ResetCalls() { mock.lockDoSomething.Lock() mock.calls.DoSomething = nil mock.lockDoSomething.Unlock() } // MoqRequesterSkipEnsure is a mock implementation of Requester. // // func TestSomethingThatUsesRequester(t *testing.T) { // // // make and configure a mocked Requester // mockedRequester := &MoqRequesterSkipEnsure{ // GetFunc: func(path string) (string, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequester in code that requires Requester // // and then make assertions. // // } type MoqRequesterSkipEnsure struct { // GetFunc mocks the Get method. GetFunc func(path string) (string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterSkipEnsure) Get(path string) (string, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( s string err error ) return s, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequester.GetCalls()) func (mock *MoqRequesterSkipEnsure) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterSkipEnsure) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterSkipEnsure) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequester does implement Requester. // If this is not the case, regenerate this file with mockery. var _ Requester = &MoqRequester{} // MoqRequester is a mock implementation of Requester. // // func TestSomethingThatUsesRequester(t *testing.T) { // // // make and configure a mocked Requester // mockedRequester := &MoqRequester{ // GetFunc: func(path string) (string, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequester in code that requires Requester // // and then make assertions. // // } type MoqRequester struct { // GetFunc mocks the Get method. GetFunc func(path string) (string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequester) Get(path string) (string, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( s string err error ) return s, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequester.GetCalls()) func (mock *MoqRequester) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequester) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequester) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that StubMatyerRequester does implement Requester. // If this is not the case, regenerate this file with mockery. var _ Requester = &StubMatyerRequester{} // StubMatyerRequester is a mock implementation of Requester. // // func TestSomethingThatUsesRequester(t *testing.T) { // // // make and configure a mocked Requester // mockedRequester := &StubMatyerRequester{ // GetFunc: func(path string) (string, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequester in code that requires Requester // // and then make assertions. // // } type StubMatyerRequester struct { // GetFunc mocks the Get method. GetFunc func(path string) (string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *StubMatyerRequester) Get(path string) (string, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( s string err error ) return s, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequester.GetCalls()) func (mock *StubMatyerRequester) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *StubMatyerRequester) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *StubMatyerRequester) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequester2 does implement Requester2. // If this is not the case, regenerate this file with mockery. var _ Requester2 = &MoqRequester2{} // MoqRequester2 is a mock implementation of Requester2. // // func TestSomethingThatUsesRequester2(t *testing.T) { // // // make and configure a mocked Requester2 // mockedRequester2 := &MoqRequester2{ // GetFunc: func(path string) error { // panic("mock out the Get method") // }, // } // // // use mockedRequester2 in code that requires Requester2 // // and then make assertions. // // } type MoqRequester2 struct { // GetFunc mocks the Get method. GetFunc func(path string) error // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequester2) Get(path string) error { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( err error ) return err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequester2.GetCalls()) func (mock *MoqRequester2) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequester2) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequester2) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequester3 does implement Requester3. // If this is not the case, regenerate this file with mockery. var _ Requester3 = &MoqRequester3{} // MoqRequester3 is a mock implementation of Requester3. // // func TestSomethingThatUsesRequester3(t *testing.T) { // // // make and configure a mocked Requester3 // mockedRequester3 := &MoqRequester3{ // GetFunc: func() error { // panic("mock out the Get method") // }, // } // // // use mockedRequester3 in code that requires Requester3 // // and then make assertions. // // } type MoqRequester3 struct { // GetFunc mocks the Get method. GetFunc func() error // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequester3) Get() error { callInfo := struct { }{} mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( err error ) return err } return mock.GetFunc() } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequester3.GetCalls()) func (mock *MoqRequester3) GetCalls() []struct { } { var calls []struct { } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequester3) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequester3) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequester4 does implement Requester4. // If this is not the case, regenerate this file with mockery. var _ Requester4 = &MoqRequester4{} // MoqRequester4 is a mock implementation of Requester4. // // func TestSomethingThatUsesRequester4(t *testing.T) { // // // make and configure a mocked Requester4 // mockedRequester4 := &MoqRequester4{ // GetFunc: func() { // panic("mock out the Get method") // }, // } // // // use mockedRequester4 in code that requires Requester4 // // and then make assertions. // // } type MoqRequester4 struct { // GetFunc mocks the Get method. GetFunc func() // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequester4) Get() { callInfo := struct { }{} mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { return } mock.GetFunc() } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequester4.GetCalls()) func (mock *MoqRequester4) GetCalls() []struct { } { var calls []struct { } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequester4) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequester4) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterArgSameAsImport does implement RequesterArgSameAsImport. // If this is not the case, regenerate this file with mockery. var _ RequesterArgSameAsImport = &MoqRequesterArgSameAsImport{} // MoqRequesterArgSameAsImport is a mock implementation of RequesterArgSameAsImport. // // func TestSomethingThatUsesRequesterArgSameAsImport(t *testing.T) { // // // make and configure a mocked RequesterArgSameAsImport // mockedRequesterArgSameAsImport := &MoqRequesterArgSameAsImport{ // GetFunc: func(json1 string) *json.RawMessage { // panic("mock out the Get method") // }, // } // // // use mockedRequesterArgSameAsImport in code that requires RequesterArgSameAsImport // // and then make assertions. // // } type MoqRequesterArgSameAsImport struct { // GetFunc mocks the Get method. GetFunc func(json1 string) *json.RawMessage // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Json1 is the json1 argument value. Json1 string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterArgSameAsImport) Get(json1 string) *json.RawMessage { callInfo := struct { Json1 string }{ Json1: json1, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( rawMessage *json.RawMessage ) return rawMessage } return mock.GetFunc(json1) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterArgSameAsImport.GetCalls()) func (mock *MoqRequesterArgSameAsImport) GetCalls() []struct { Json1 string } { var calls []struct { Json1 string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterArgSameAsImport) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterArgSameAsImport) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterArgSameAsNamedImport does implement RequesterArgSameAsNamedImport. // If this is not the case, regenerate this file with mockery. var _ RequesterArgSameAsNamedImport = &MoqRequesterArgSameAsNamedImport{} // MoqRequesterArgSameAsNamedImport is a mock implementation of RequesterArgSameAsNamedImport. // // func TestSomethingThatUsesRequesterArgSameAsNamedImport(t *testing.T) { // // // make and configure a mocked RequesterArgSameAsNamedImport // mockedRequesterArgSameAsNamedImport := &MoqRequesterArgSameAsNamedImport{ // GetFunc: func(json1 string) *json.RawMessage { // panic("mock out the Get method") // }, // } // // // use mockedRequesterArgSameAsNamedImport in code that requires RequesterArgSameAsNamedImport // // and then make assertions. // // } type MoqRequesterArgSameAsNamedImport struct { // GetFunc mocks the Get method. GetFunc func(json1 string) *json.RawMessage // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Json1 is the json1 argument value. Json1 string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterArgSameAsNamedImport) Get(json1 string) *json.RawMessage { callInfo := struct { Json1 string }{ Json1: json1, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( rawMessage *json.RawMessage ) return rawMessage } return mock.GetFunc(json1) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterArgSameAsNamedImport.GetCalls()) func (mock *MoqRequesterArgSameAsNamedImport) GetCalls() []struct { Json1 string } { var calls []struct { Json1 string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterArgSameAsNamedImport) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterArgSameAsNamedImport) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterArgSameAsPkg does implement RequesterArgSameAsPkg. // If this is not the case, regenerate this file with mockery. var _ RequesterArgSameAsPkg = &MoqRequesterArgSameAsPkg{} // MoqRequesterArgSameAsPkg is a mock implementation of RequesterArgSameAsPkg. // // func TestSomethingThatUsesRequesterArgSameAsPkg(t *testing.T) { // // // make and configure a mocked RequesterArgSameAsPkg // mockedRequesterArgSameAsPkg := &MoqRequesterArgSameAsPkg{ // GetFunc: func(test1 string) { // panic("mock out the Get method") // }, // } // // // use mockedRequesterArgSameAsPkg in code that requires RequesterArgSameAsPkg // // and then make assertions. // // } type MoqRequesterArgSameAsPkg struct { // GetFunc mocks the Get method. GetFunc func(test1 string) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Test1 is the test1 argument value. Test1 string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterArgSameAsPkg) Get(test1 string) { callInfo := struct { Test1 string }{ Test1: test1, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { return } mock.GetFunc(test1) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterArgSameAsPkg.GetCalls()) func (mock *MoqRequesterArgSameAsPkg) GetCalls() []struct { Test1 string } { var calls []struct { Test1 string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterArgSameAsPkg) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterArgSameAsPkg) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterArray does implement RequesterArray. // If this is not the case, regenerate this file with mockery. var _ RequesterArray = &MoqRequesterArray{} // MoqRequesterArray is a mock implementation of RequesterArray. // // func TestSomethingThatUsesRequesterArray(t *testing.T) { // // // make and configure a mocked RequesterArray // mockedRequesterArray := &MoqRequesterArray{ // GetFunc: func(path string) ([2]string, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequesterArray in code that requires RequesterArray // // and then make assertions. // // } type MoqRequesterArray struct { // GetFunc mocks the Get method. GetFunc func(path string) ([2]string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterArray) Get(path string) ([2]string, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( strings [2]string err error ) return strings, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterArray.GetCalls()) func (mock *MoqRequesterArray) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterArray) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterArray) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterElided does implement RequesterElided. // If this is not the case, regenerate this file with mockery. var _ RequesterElided = &MoqRequesterElided{} // MoqRequesterElided is a mock implementation of RequesterElided. // // func TestSomethingThatUsesRequesterElided(t *testing.T) { // // // make and configure a mocked RequesterElided // mockedRequesterElided := &MoqRequesterElided{ // GetFunc: func(path string, url string) error { // panic("mock out the Get method") // }, // } // // // use mockedRequesterElided in code that requires RequesterElided // // and then make assertions. // // } type MoqRequesterElided struct { // GetFunc mocks the Get method. GetFunc func(path string, url string) error // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string // URL is the url argument value. URL string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterElided) Get(path string, url string) error { callInfo := struct { Path string URL string }{ Path: path, URL: url, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( err error ) return err } return mock.GetFunc(path, url) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterElided.GetCalls()) func (mock *MoqRequesterElided) GetCalls() []struct { Path string URL string } { var calls []struct { Path string URL string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterElided) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterElided) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterIface does implement RequesterIface. // If this is not the case, regenerate this file with mockery. var _ RequesterIface = &MoqRequesterIface{} // MoqRequesterIface is a mock implementation of RequesterIface. // // func TestSomethingThatUsesRequesterIface(t *testing.T) { // // // make and configure a mocked RequesterIface // mockedRequesterIface := &MoqRequesterIface{ // GetFunc: func() io.Reader { // panic("mock out the Get method") // }, // } // // // use mockedRequesterIface in code that requires RequesterIface // // and then make assertions. // // } type MoqRequesterIface struct { // GetFunc mocks the Get method. GetFunc func() io.Reader // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterIface) Get() io.Reader { callInfo := struct { }{} mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( reader io.Reader ) return reader } return mock.GetFunc() } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterIface.GetCalls()) func (mock *MoqRequesterIface) GetCalls() []struct { } { var calls []struct { } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterIface) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterIface) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterNS does implement RequesterNS. // If this is not the case, regenerate this file with mockery. var _ RequesterNS = &MoqRequesterNS{} // MoqRequesterNS is a mock implementation of RequesterNS. // // func TestSomethingThatUsesRequesterNS(t *testing.T) { // // // make and configure a mocked RequesterNS // mockedRequesterNS := &MoqRequesterNS{ // GetFunc: func(path string) (http.Response, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequesterNS in code that requires RequesterNS // // and then make assertions. // // } type MoqRequesterNS struct { // GetFunc mocks the Get method. GetFunc func(path string) (http.Response, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterNS) Get(path string) (http.Response, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( response http.Response err error ) return response, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterNS.GetCalls()) func (mock *MoqRequesterNS) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterNS) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterNS) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterPtr does implement RequesterPtr. // If this is not the case, regenerate this file with mockery. var _ RequesterPtr = &MoqRequesterPtr{} // MoqRequesterPtr is a mock implementation of RequesterPtr. // // func TestSomethingThatUsesRequesterPtr(t *testing.T) { // // // make and configure a mocked RequesterPtr // mockedRequesterPtr := &MoqRequesterPtr{ // GetFunc: func(path string) (*string, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequesterPtr in code that requires RequesterPtr // // and then make assertions. // // } type MoqRequesterPtr struct { // GetFunc mocks the Get method. GetFunc func(path string) (*string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterPtr) Get(path string) (*string, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( s *string err error ) return s, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterPtr.GetCalls()) func (mock *MoqRequesterPtr) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterPtr) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterPtr) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterReturnElided does implement RequesterReturnElided. // If this is not the case, regenerate this file with mockery. var _ RequesterReturnElided = &MoqRequesterReturnElided{} // MoqRequesterReturnElided is a mock implementation of RequesterReturnElided. // // func TestSomethingThatUsesRequesterReturnElided(t *testing.T) { // // // make and configure a mocked RequesterReturnElided // mockedRequesterReturnElided := &MoqRequesterReturnElided{ // GetFunc: func(path string) (int, int, int, error) { // panic("mock out the Get method") // }, // PutFunc: func(path string) (int, error) { // panic("mock out the Put method") // }, // } // // // use mockedRequesterReturnElided in code that requires RequesterReturnElided // // and then make assertions. // // } type MoqRequesterReturnElided struct { // GetFunc mocks the Get method. GetFunc func(path string) (int, int, int, error) // PutFunc mocks the Put method. PutFunc func(path string) (int, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } // Put holds details about calls to the Put method. Put []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex lockPut sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterReturnElided) Get(path string) (int, int, int, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( a int b int c int err error ) return a, b, c, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterReturnElided.GetCalls()) func (mock *MoqRequesterReturnElided) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterReturnElided) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Put calls PutFunc. func (mock *MoqRequesterReturnElided) Put(path string) (int, error) { callInfo := struct { Path string }{ Path: path, } mock.lockPut.Lock() mock.calls.Put = append(mock.calls.Put, callInfo) mock.lockPut.Unlock() if mock.PutFunc == nil { var ( n int err error ) return n, err } return mock.PutFunc(path) } // PutCalls gets all the calls that were made to Put. // Check the length with: // // len(mockedRequesterReturnElided.PutCalls()) func (mock *MoqRequesterReturnElided) PutCalls() []struct { Path string } { var calls []struct { Path string } mock.lockPut.RLock() calls = mock.calls.Put mock.lockPut.RUnlock() return calls } // ResetPutCalls reset all the calls that were made to Put. func (mock *MoqRequesterReturnElided) ResetPutCalls() { mock.lockPut.Lock() mock.calls.Put = nil mock.lockPut.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterReturnElided) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() mock.lockPut.Lock() mock.calls.Put = nil mock.lockPut.Unlock() } // Ensure that MoqRequesterSlice does implement RequesterSlice. // If this is not the case, regenerate this file with mockery. var _ RequesterSlice = &MoqRequesterSlice{} // MoqRequesterSlice is a mock implementation of RequesterSlice. // // func TestSomethingThatUsesRequesterSlice(t *testing.T) { // // // make and configure a mocked RequesterSlice // mockedRequesterSlice := &MoqRequesterSlice{ // GetFunc: func(path string) ([]string, error) { // panic("mock out the Get method") // }, // } // // // use mockedRequesterSlice in code that requires RequesterSlice // // and then make assertions. // // } type MoqRequesterSlice struct { // GetFunc mocks the Get method. GetFunc func(path string) ([]string, error) // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Path is the path argument value. Path string } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterSlice) Get(path string) ([]string, error) { callInfo := struct { Path string }{ Path: path, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( strings []string err error ) return strings, err } return mock.GetFunc(path) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterSlice.GetCalls()) func (mock *MoqRequesterSlice) GetCalls() []struct { Path string } { var calls []struct { Path string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterSlice) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterSlice) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqrequesterUnexported does implement requesterUnexported. // If this is not the case, regenerate this file with mockery. var _ requesterUnexported = &MoqrequesterUnexported{} // MoqrequesterUnexported is a mock implementation of requesterUnexported. // // func TestSomethingThatUsesrequesterUnexported(t *testing.T) { // // // make and configure a mocked requesterUnexported // mockedrequesterUnexported := &MoqrequesterUnexported{ // GetFunc: func() { // panic("mock out the Get method") // }, // } // // // use mockedrequesterUnexported in code that requires requesterUnexported // // and then make assertions. // // } type MoqrequesterUnexported struct { // GetFunc mocks the Get method. GetFunc func() // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { } } lockGet sync.RWMutex } // Get calls GetFunc. func (mock *MoqrequesterUnexported) Get() { callInfo := struct { }{} mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { return } mock.GetFunc() } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedrequesterUnexported.GetCalls()) func (mock *MoqrequesterUnexported) GetCalls() []struct { } { var calls []struct { } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqrequesterUnexported) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqrequesterUnexported) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // Ensure that MoqRequesterVariadic does implement RequesterVariadic. // If this is not the case, regenerate this file with mockery. var _ RequesterVariadic = &MoqRequesterVariadic{} // MoqRequesterVariadic is a mock implementation of RequesterVariadic. // // func TestSomethingThatUsesRequesterVariadic(t *testing.T) { // // // make and configure a mocked RequesterVariadic // mockedRequesterVariadic := &MoqRequesterVariadic{ // GetFunc: func(values ...string) bool { // panic("mock out the Get method") // }, // MultiWriteToFileFunc: func(filename string, w ...io.Writer) string { // panic("mock out the MultiWriteToFile method") // }, // OneInterfaceFunc: func(a ...interface{}) bool { // panic("mock out the OneInterface method") // }, // SprintfFunc: func(format string, a ...interface{}) string { // panic("mock out the Sprintf method") // }, // } // // // use mockedRequesterVariadic in code that requires RequesterVariadic // // and then make assertions. // // } type MoqRequesterVariadic struct { // GetFunc mocks the Get method. GetFunc func(values ...string) bool // MultiWriteToFileFunc mocks the MultiWriteToFile method. MultiWriteToFileFunc func(filename string, w ...io.Writer) string // OneInterfaceFunc mocks the OneInterface method. OneInterfaceFunc func(a ...interface{}) bool // SprintfFunc mocks the Sprintf method. SprintfFunc func(format string, a ...interface{}) string // calls tracks calls to the methods. calls struct { // Get holds details about calls to the Get method. Get []struct { // Values is the values argument value. Values []string } // MultiWriteToFile holds details about calls to the MultiWriteToFile method. MultiWriteToFile []struct { // Filename is the filename argument value. Filename string // W is the w argument value. W []io.Writer } // OneInterface holds details about calls to the OneInterface method. OneInterface []struct { // A is the a argument value. A []interface{} } // Sprintf holds details about calls to the Sprintf method. Sprintf []struct { // Format is the format argument value. Format string // A is the a argument value. A []interface{} } } lockGet sync.RWMutex lockMultiWriteToFile sync.RWMutex lockOneInterface sync.RWMutex lockSprintf sync.RWMutex } // Get calls GetFunc. func (mock *MoqRequesterVariadic) Get(values ...string) bool { callInfo := struct { Values []string }{ Values: values, } mock.lockGet.Lock() mock.calls.Get = append(mock.calls.Get, callInfo) mock.lockGet.Unlock() if mock.GetFunc == nil { var ( b bool ) return b } return mock.GetFunc(values...) } // GetCalls gets all the calls that were made to Get. // Check the length with: // // len(mockedRequesterVariadic.GetCalls()) func (mock *MoqRequesterVariadic) GetCalls() []struct { Values []string } { var calls []struct { Values []string } mock.lockGet.RLock() calls = mock.calls.Get mock.lockGet.RUnlock() return calls } // ResetGetCalls reset all the calls that were made to Get. func (mock *MoqRequesterVariadic) ResetGetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() } // MultiWriteToFile calls MultiWriteToFileFunc. func (mock *MoqRequesterVariadic) MultiWriteToFile(filename string, w ...io.Writer) string { callInfo := struct { Filename string W []io.Writer }{ Filename: filename, W: w, } mock.lockMultiWriteToFile.Lock() mock.calls.MultiWriteToFile = append(mock.calls.MultiWriteToFile, callInfo) mock.lockMultiWriteToFile.Unlock() if mock.MultiWriteToFileFunc == nil { var ( s string ) return s } return mock.MultiWriteToFileFunc(filename, w...) } // MultiWriteToFileCalls gets all the calls that were made to MultiWriteToFile. // Check the length with: // // len(mockedRequesterVariadic.MultiWriteToFileCalls()) func (mock *MoqRequesterVariadic) MultiWriteToFileCalls() []struct { Filename string W []io.Writer } { var calls []struct { Filename string W []io.Writer } mock.lockMultiWriteToFile.RLock() calls = mock.calls.MultiWriteToFile mock.lockMultiWriteToFile.RUnlock() return calls } // ResetMultiWriteToFileCalls reset all the calls that were made to MultiWriteToFile. func (mock *MoqRequesterVariadic) ResetMultiWriteToFileCalls() { mock.lockMultiWriteToFile.Lock() mock.calls.MultiWriteToFile = nil mock.lockMultiWriteToFile.Unlock() } // OneInterface calls OneInterfaceFunc. func (mock *MoqRequesterVariadic) OneInterface(a ...interface{}) bool { callInfo := struct { A []interface{} }{ A: a, } mock.lockOneInterface.Lock() mock.calls.OneInterface = append(mock.calls.OneInterface, callInfo) mock.lockOneInterface.Unlock() if mock.OneInterfaceFunc == nil { var ( b bool ) return b } return mock.OneInterfaceFunc(a...) } // OneInterfaceCalls gets all the calls that were made to OneInterface. // Check the length with: // // len(mockedRequesterVariadic.OneInterfaceCalls()) func (mock *MoqRequesterVariadic) OneInterfaceCalls() []struct { A []interface{} } { var calls []struct { A []interface{} } mock.lockOneInterface.RLock() calls = mock.calls.OneInterface mock.lockOneInterface.RUnlock() return calls } // ResetOneInterfaceCalls reset all the calls that were made to OneInterface. func (mock *MoqRequesterVariadic) ResetOneInterfaceCalls() { mock.lockOneInterface.Lock() mock.calls.OneInterface = nil mock.lockOneInterface.Unlock() } // Sprintf calls SprintfFunc. func (mock *MoqRequesterVariadic) Sprintf(format string, a ...interface{}) string { callInfo := struct { Format string A []interface{} }{ Format: format, A: a, } mock.lockSprintf.Lock() mock.calls.Sprintf = append(mock.calls.Sprintf, callInfo) mock.lockSprintf.Unlock() if mock.SprintfFunc == nil { var ( s string ) return s } return mock.SprintfFunc(format, a...) } // SprintfCalls gets all the calls that were made to Sprintf. // Check the length with: // // len(mockedRequesterVariadic.SprintfCalls()) func (mock *MoqRequesterVariadic) SprintfCalls() []struct { Format string A []interface{} } { var calls []struct { Format string A []interface{} } mock.lockSprintf.RLock() calls = mock.calls.Sprintf mock.lockSprintf.RUnlock() return calls } // ResetSprintfCalls reset all the calls that were made to Sprintf. func (mock *MoqRequesterVariadic) ResetSprintfCalls() { mock.lockSprintf.Lock() mock.calls.Sprintf = nil mock.lockSprintf.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqRequesterVariadic) ResetCalls() { mock.lockGet.Lock() mock.calls.Get = nil mock.lockGet.Unlock() mock.lockMultiWriteToFile.Lock() mock.calls.MultiWriteToFile = nil mock.lockMultiWriteToFile.Unlock() mock.lockOneInterface.Lock() mock.calls.OneInterface = nil mock.lockOneInterface.Unlock() mock.lockSprintf.Lock() mock.calls.Sprintf = nil mock.lockSprintf.Unlock() } // Ensure that MoqExample does implement Example. // If this is not the case, regenerate this file with mockery. var _ Example = &MoqExample{} // MoqExample is a mock implementation of Example. // // func TestSomethingThatUsesExample(t *testing.T) { // // // make and configure a mocked Example // mockedExample := &MoqExample{ // AFunc: func() http.Flusher { // panic("mock out the A method") // }, // BFunc: func(fixtureshttp string) http0.MyStruct { // panic("mock out the B method") // }, // CFunc: func(fixtureshttp string) http1.MyStruct { // panic("mock out the C method") // }, // } // // // use mockedExample in code that requires Example // // and then make assertions. // // } type MoqExample struct { // AFunc mocks the A method. AFunc func() http.Flusher // BFunc mocks the B method. BFunc func(fixtureshttp string) http0.MyStruct // CFunc mocks the C method. CFunc func(fixtureshttp string) http1.MyStruct // calls tracks calls to the methods. calls struct { // A holds details about calls to the A method. A []struct { } // B holds details about calls to the B method. B []struct { // Fixtureshttp is the fixtureshttp argument value. Fixtureshttp string } // C holds details about calls to the C method. C []struct { // Fixtureshttp is the fixtureshttp argument value. Fixtureshttp string } } lockA sync.RWMutex lockB sync.RWMutex lockC sync.RWMutex } // A calls AFunc. func (mock *MoqExample) A() http.Flusher { callInfo := struct { }{} mock.lockA.Lock() mock.calls.A = append(mock.calls.A, callInfo) mock.lockA.Unlock() if mock.AFunc == nil { var ( flusher http.Flusher ) return flusher } return mock.AFunc() } // ACalls gets all the calls that were made to A. // Check the length with: // // len(mockedExample.ACalls()) func (mock *MoqExample) ACalls() []struct { } { var calls []struct { } mock.lockA.RLock() calls = mock.calls.A mock.lockA.RUnlock() return calls } // ResetACalls reset all the calls that were made to A. func (mock *MoqExample) ResetACalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() } // B calls BFunc. func (mock *MoqExample) B(fixtureshttp string) http0.MyStruct { callInfo := struct { Fixtureshttp string }{ Fixtureshttp: fixtureshttp, } mock.lockB.Lock() mock.calls.B = append(mock.calls.B, callInfo) mock.lockB.Unlock() if mock.BFunc == nil { var ( myStruct http0.MyStruct ) return myStruct } return mock.BFunc(fixtureshttp) } // BCalls gets all the calls that were made to B. // Check the length with: // // len(mockedExample.BCalls()) func (mock *MoqExample) BCalls() []struct { Fixtureshttp string } { var calls []struct { Fixtureshttp string } mock.lockB.RLock() calls = mock.calls.B mock.lockB.RUnlock() return calls } // ResetBCalls reset all the calls that were made to B. func (mock *MoqExample) ResetBCalls() { mock.lockB.Lock() mock.calls.B = nil mock.lockB.Unlock() } // C calls CFunc. func (mock *MoqExample) C(fixtureshttp string) http1.MyStruct { callInfo := struct { Fixtureshttp string }{ Fixtureshttp: fixtureshttp, } mock.lockC.Lock() mock.calls.C = append(mock.calls.C, callInfo) mock.lockC.Unlock() if mock.CFunc == nil { var ( myStruct http1.MyStruct ) return myStruct } return mock.CFunc(fixtureshttp) } // CCalls gets all the calls that were made to C. // Check the length with: // // len(mockedExample.CCalls()) func (mock *MoqExample) CCalls() []struct { Fixtureshttp string } { var calls []struct { Fixtureshttp string } mock.lockC.RLock() calls = mock.calls.C mock.lockC.RUnlock() return calls } // ResetCCalls reset all the calls that were made to C. func (mock *MoqExample) ResetCCalls() { mock.lockC.Lock() mock.calls.C = nil mock.lockC.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqExample) ResetCalls() { mock.lockA.Lock() mock.calls.A = nil mock.lockA.Unlock() mock.lockB.Lock() mock.calls.B = nil mock.lockB.Unlock() mock.lockC.Lock() mock.calls.C = nil mock.lockC.Unlock() } // Ensure that MoqA does implement A. // If this is not the case, regenerate this file with mockery. var _ A = &MoqA{} // MoqA is a mock implementation of A. // // func TestSomethingThatUsesA(t *testing.T) { // // // make and configure a mocked A // mockedA := &MoqA{ // CallFunc: func() (B, error) { // panic("mock out the Call method") // }, // } // // // use mockedA in code that requires A // // and then make assertions. // // } type MoqA struct { // CallFunc mocks the Call method. CallFunc func() (B, error) // calls tracks calls to the methods. calls struct { // Call holds details about calls to the Call method. Call []struct { } } lockCall sync.RWMutex } // Call calls CallFunc. func (mock *MoqA) Call() (B, error) { callInfo := struct { }{} mock.lockCall.Lock() mock.calls.Call = append(mock.calls.Call, callInfo) mock.lockCall.Unlock() if mock.CallFunc == nil { var ( b B err error ) return b, err } return mock.CallFunc() } // CallCalls gets all the calls that were made to Call. // Check the length with: // // len(mockedA.CallCalls()) func (mock *MoqA) CallCalls() []struct { } { var calls []struct { } mock.lockCall.RLock() calls = mock.calls.Call mock.lockCall.RUnlock() return calls } // ResetCallCalls reset all the calls that were made to Call. func (mock *MoqA) ResetCallCalls() { mock.lockCall.Lock() mock.calls.Call = nil mock.lockCall.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqA) ResetCalls() { mock.lockCall.Lock() mock.calls.Call = nil mock.lockCall.Unlock() } // Ensure that MoqStructWithTag does implement StructWithTag. // If this is not the case, regenerate this file with mockery. var _ StructWithTag = &MoqStructWithTag{} // MoqStructWithTag is a mock implementation of StructWithTag. // // func TestSomethingThatUsesStructWithTag(t *testing.T) { // // // make and configure a mocked StructWithTag // mockedStructWithTag := &MoqStructWithTag{ // MethodAFunc: func(v *struct{FieldA int "json:\"field_a\""; FieldB int "json:\"field_b\" xml:\"field_b\""}) *struct{FieldC int "json:\"field_c\""; FieldD int "json:\"field_d\" xml:\"field_d\""} { // panic("mock out the MethodA method") // }, // } // // // use mockedStructWithTag in code that requires StructWithTag // // and then make assertions. // // } type MoqStructWithTag struct { // MethodAFunc mocks the MethodA method. MethodAFunc func(v *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" }) *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" } // calls tracks calls to the methods. calls struct { // MethodA holds details about calls to the MethodA method. MethodA []struct { // V is the v argument value. V *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" } } } lockMethodA sync.RWMutex } // MethodA calls MethodAFunc. func (mock *MoqStructWithTag) MethodA(v *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" }) *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" } { callInfo := struct { V *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" } }{ V: v, } mock.lockMethodA.Lock() mock.calls.MethodA = append(mock.calls.MethodA, callInfo) mock.lockMethodA.Unlock() if mock.MethodAFunc == nil { var ( val *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" } ) return val } return mock.MethodAFunc(v) } // MethodACalls gets all the calls that were made to MethodA. // Check the length with: // // len(mockedStructWithTag.MethodACalls()) func (mock *MoqStructWithTag) MethodACalls() []struct { V *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" } } { var calls []struct { V *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" } } mock.lockMethodA.RLock() calls = mock.calls.MethodA mock.lockMethodA.RUnlock() return calls } // ResetMethodACalls reset all the calls that were made to MethodA. func (mock *MoqStructWithTag) ResetMethodACalls() { mock.lockMethodA.Lock() mock.calls.MethodA = nil mock.lockMethodA.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqStructWithTag) ResetCalls() { mock.lockMethodA.Lock() mock.calls.MethodA = nil mock.lockMethodA.Unlock() } // Ensure that MoqUnsafeInterface does implement UnsafeInterface. // If this is not the case, regenerate this file with mockery. var _ UnsafeInterface = &MoqUnsafeInterface{} // MoqUnsafeInterface is a mock implementation of UnsafeInterface. // // func TestSomethingThatUsesUnsafeInterface(t *testing.T) { // // // make and configure a mocked UnsafeInterface // mockedUnsafeInterface := &MoqUnsafeInterface{ // DoFunc: func(ptr *unsafe.Pointer) { // panic("mock out the Do method") // }, // } // // // use mockedUnsafeInterface in code that requires UnsafeInterface // // and then make assertions. // // } type MoqUnsafeInterface struct { // DoFunc mocks the Do method. DoFunc func(ptr *unsafe.Pointer) // calls tracks calls to the methods. calls struct { // Do holds details about calls to the Do method. Do []struct { // Ptr is the ptr argument value. Ptr *unsafe.Pointer } } lockDo sync.RWMutex } // Do calls DoFunc. func (mock *MoqUnsafeInterface) Do(ptr *unsafe.Pointer) { callInfo := struct { Ptr *unsafe.Pointer }{ Ptr: ptr, } mock.lockDo.Lock() mock.calls.Do = append(mock.calls.Do, callInfo) mock.lockDo.Unlock() if mock.DoFunc == nil { return } mock.DoFunc(ptr) } // DoCalls gets all the calls that were made to Do. // Check the length with: // // len(mockedUnsafeInterface.DoCalls()) func (mock *MoqUnsafeInterface) DoCalls() []struct { Ptr *unsafe.Pointer } { var calls []struct { Ptr *unsafe.Pointer } mock.lockDo.RLock() calls = mock.calls.Do mock.lockDo.RUnlock() return calls } // ResetDoCalls reset all the calls that were made to Do. func (mock *MoqUnsafeInterface) ResetDoCalls() { mock.lockDo.Lock() mock.calls.Do = nil mock.lockDo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqUnsafeInterface) ResetCalls() { mock.lockDo.Lock() mock.calls.Do = nil mock.lockDo.Unlock() } // Ensure that MoqVariadic does implement Variadic. // If this is not the case, regenerate this file with mockery. var _ Variadic = &MoqVariadic{} // MoqVariadic is a mock implementation of Variadic. // // func TestSomethingThatUsesVariadic(t *testing.T) { // // // make and configure a mocked Variadic // mockedVariadic := &MoqVariadic{ // VariadicFunctionFunc: func(str string, vFunc VariadicFunction) error { // panic("mock out the VariadicFunction method") // }, // } // // // use mockedVariadic in code that requires Variadic // // and then make assertions. // // } type MoqVariadic struct { // VariadicFunctionFunc mocks the VariadicFunction method. VariadicFunctionFunc func(str string, vFunc VariadicFunction) error // calls tracks calls to the methods. calls struct { // VariadicFunction holds details about calls to the VariadicFunction method. VariadicFunction []struct { // Str is the str argument value. Str string // VFunc is the vFunc argument value. VFunc VariadicFunction } } lockVariadicFunction sync.RWMutex } // VariadicFunction calls VariadicFunctionFunc. func (mock *MoqVariadic) VariadicFunction(str string, vFunc VariadicFunction) error { callInfo := struct { Str string VFunc VariadicFunction }{ Str: str, VFunc: vFunc, } mock.lockVariadicFunction.Lock() mock.calls.VariadicFunction = append(mock.calls.VariadicFunction, callInfo) mock.lockVariadicFunction.Unlock() if mock.VariadicFunctionFunc == nil { var ( err error ) return err } return mock.VariadicFunctionFunc(str, vFunc) } // VariadicFunctionCalls gets all the calls that were made to VariadicFunction. // Check the length with: // // len(mockedVariadic.VariadicFunctionCalls()) func (mock *MoqVariadic) VariadicFunctionCalls() []struct { Str string VFunc VariadicFunction } { var calls []struct { Str string VFunc VariadicFunction } mock.lockVariadicFunction.RLock() calls = mock.calls.VariadicFunction mock.lockVariadicFunction.RUnlock() return calls } // ResetVariadicFunctionCalls reset all the calls that were made to VariadicFunction. func (mock *MoqVariadic) ResetVariadicFunctionCalls() { mock.lockVariadicFunction.Lock() mock.calls.VariadicFunction = nil mock.lockVariadicFunction.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqVariadic) ResetCalls() { mock.lockVariadicFunction.Lock() mock.calls.VariadicFunction = nil mock.lockVariadicFunction.Unlock() } // Ensure that MoqVariadicReturnFunc does implement VariadicReturnFunc. // If this is not the case, regenerate this file with mockery. var _ VariadicReturnFunc = &MoqVariadicReturnFunc{} // MoqVariadicReturnFunc is a mock implementation of VariadicReturnFunc. // // func TestSomethingThatUsesVariadicReturnFunc(t *testing.T) { // // // make and configure a mocked VariadicReturnFunc // mockedVariadicReturnFunc := &MoqVariadicReturnFunc{ // SampleMethodFunc: func(str string) func(str string, arr []int, a ...interface{}) { // panic("mock out the SampleMethod method") // }, // } // // // use mockedVariadicReturnFunc in code that requires VariadicReturnFunc // // and then make assertions. // // } type MoqVariadicReturnFunc struct { // SampleMethodFunc mocks the SampleMethod method. SampleMethodFunc func(str string) func(str string, arr []int, a ...interface{}) // calls tracks calls to the methods. calls struct { // SampleMethod holds details about calls to the SampleMethod method. SampleMethod []struct { // Str is the str argument value. Str string } } lockSampleMethod sync.RWMutex } // SampleMethod calls SampleMethodFunc. func (mock *MoqVariadicReturnFunc) SampleMethod(str string) func(str string, arr []int, a ...interface{}) { callInfo := struct { Str string }{ Str: str, } mock.lockSampleMethod.Lock() mock.calls.SampleMethod = append(mock.calls.SampleMethod, callInfo) mock.lockSampleMethod.Unlock() if mock.SampleMethodFunc == nil { var ( fn func(str string, arr []int, a ...interface{}) ) return fn } return mock.SampleMethodFunc(str) } // SampleMethodCalls gets all the calls that were made to SampleMethod. // Check the length with: // // len(mockedVariadicReturnFunc.SampleMethodCalls()) func (mock *MoqVariadicReturnFunc) SampleMethodCalls() []struct { Str string } { var calls []struct { Str string } mock.lockSampleMethod.RLock() calls = mock.calls.SampleMethod mock.lockSampleMethod.RUnlock() return calls } // ResetSampleMethodCalls reset all the calls that were made to SampleMethod. func (mock *MoqVariadicReturnFunc) ResetSampleMethodCalls() { mock.lockSampleMethod.Lock() mock.calls.SampleMethod = nil mock.lockSampleMethod.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqVariadicReturnFunc) ResetCalls() { mock.lockSampleMethod.Lock() mock.calls.SampleMethod = nil mock.lockSampleMethod.Unlock() } // Ensure that MoqVariadicWithMultipleReturns does implement VariadicWithMultipleReturns. // If this is not the case, regenerate this file with mockery. var _ VariadicWithMultipleReturns = &MoqVariadicWithMultipleReturns{} // MoqVariadicWithMultipleReturns is a mock implementation of VariadicWithMultipleReturns. // // func TestSomethingThatUsesVariadicWithMultipleReturns(t *testing.T) { // // // make and configure a mocked VariadicWithMultipleReturns // mockedVariadicWithMultipleReturns := &MoqVariadicWithMultipleReturns{ // FooFunc: func(one string, two ...string) (string, error) { // panic("mock out the Foo method") // }, // } // // // use mockedVariadicWithMultipleReturns in code that requires VariadicWithMultipleReturns // // and then make assertions. // // } type MoqVariadicWithMultipleReturns struct { // FooFunc mocks the Foo method. FooFunc func(one string, two ...string) (string, error) // calls tracks calls to the methods. calls struct { // Foo holds details about calls to the Foo method. Foo []struct { // One is the one argument value. One string // Two is the two argument value. Two []string } } lockFoo sync.RWMutex } // Foo calls FooFunc. func (mock *MoqVariadicWithMultipleReturns) Foo(one string, two ...string) (string, error) { callInfo := struct { One string Two []string }{ One: one, Two: two, } mock.lockFoo.Lock() mock.calls.Foo = append(mock.calls.Foo, callInfo) mock.lockFoo.Unlock() if mock.FooFunc == nil { var ( result string err error ) return result, err } return mock.FooFunc(one, two...) } // FooCalls gets all the calls that were made to Foo. // Check the length with: // // len(mockedVariadicWithMultipleReturns.FooCalls()) func (mock *MoqVariadicWithMultipleReturns) FooCalls() []struct { One string Two []string } { var calls []struct { One string Two []string } mock.lockFoo.RLock() calls = mock.calls.Foo mock.lockFoo.RUnlock() return calls } // ResetFooCalls reset all the calls that were made to Foo. func (mock *MoqVariadicWithMultipleReturns) ResetFooCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqVariadicWithMultipleReturns) ResetCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // Ensure that MoqVariadicWithNoReturns does implement VariadicWithNoReturns. // If this is not the case, regenerate this file with mockery. var _ VariadicWithNoReturns = &MoqVariadicWithNoReturns{} // MoqVariadicWithNoReturns is a mock implementation of VariadicWithNoReturns. // // func TestSomethingThatUsesVariadicWithNoReturns(t *testing.T) { // // // make and configure a mocked VariadicWithNoReturns // mockedVariadicWithNoReturns := &MoqVariadicWithNoReturns{ // FooFunc: func(one string, two ...string) { // panic("mock out the Foo method") // }, // } // // // use mockedVariadicWithNoReturns in code that requires VariadicWithNoReturns // // and then make assertions. // // } type MoqVariadicWithNoReturns struct { // FooFunc mocks the Foo method. FooFunc func(one string, two ...string) // calls tracks calls to the methods. calls struct { // Foo holds details about calls to the Foo method. Foo []struct { // One is the one argument value. One string // Two is the two argument value. Two []string } } lockFoo sync.RWMutex } // Foo calls FooFunc. func (mock *MoqVariadicWithNoReturns) Foo(one string, two ...string) { callInfo := struct { One string Two []string }{ One: one, Two: two, } mock.lockFoo.Lock() mock.calls.Foo = append(mock.calls.Foo, callInfo) mock.lockFoo.Unlock() if mock.FooFunc == nil { return } mock.FooFunc(one, two...) } // FooCalls gets all the calls that were made to Foo. // Check the length with: // // len(mockedVariadicWithNoReturns.FooCalls()) func (mock *MoqVariadicWithNoReturns) FooCalls() []struct { One string Two []string } { var calls []struct { One string Two []string } mock.lockFoo.RLock() calls = mock.calls.Foo mock.lockFoo.RUnlock() return calls } // ResetFooCalls reset all the calls that were made to Foo. func (mock *MoqVariadicWithNoReturns) ResetFooCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqVariadicWithNoReturns) ResetCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } ================================================ FILE: internal/fixtures/mocks_net_http_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package test import ( "net/http" mock "github.com/stretchr/testify/mock" ) // NewMockResponseWriter creates a new instance of MockResponseWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockResponseWriter(t interface { mock.TestingT Cleanup(func()) }) *MockResponseWriter { mock := &MockResponseWriter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockResponseWriter is an autogenerated mock type for the ResponseWriter type type MockResponseWriter struct { mock.Mock } type MockResponseWriter_Expecter struct { mock *mock.Mock } func (_m *MockResponseWriter) EXPECT() *MockResponseWriter_Expecter { return &MockResponseWriter_Expecter{mock: &_m.Mock} } // Header provides a mock function for the type MockResponseWriter func (_mock *MockResponseWriter) Header() http.Header { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Header") } var r0 http.Header if returnFunc, ok := ret.Get(0).(func() http.Header); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(http.Header) } } return r0 } // MockResponseWriter_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header' type MockResponseWriter_Header_Call struct { *mock.Call } // Header is a helper method to define mock.On call func (_e *MockResponseWriter_Expecter) Header() *MockResponseWriter_Header_Call { return &MockResponseWriter_Header_Call{Call: _e.mock.On("Header")} } func (_c *MockResponseWriter_Header_Call) Run(run func()) *MockResponseWriter_Header_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockResponseWriter_Header_Call) Return(header http.Header) *MockResponseWriter_Header_Call { _c.Call.Return(header) return _c } func (_c *MockResponseWriter_Header_Call) RunAndReturn(run func() http.Header) *MockResponseWriter_Header_Call { _c.Call.Return(run) return _c } // Write provides a mock function for the type MockResponseWriter func (_mock *MockResponseWriter) Write(bytes []byte) (int, error) { ret := _mock.Called(bytes) if len(ret) == 0 { panic("no return value specified for Write") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(bytes) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(bytes) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(bytes) } else { r1 = ret.Error(1) } return r0, r1 } // MockResponseWriter_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' type MockResponseWriter_Write_Call struct { *mock.Call } // Write is a helper method to define mock.On call // - bytes []byte func (_e *MockResponseWriter_Expecter) Write(bytes interface{}) *MockResponseWriter_Write_Call { return &MockResponseWriter_Write_Call{Call: _e.mock.On("Write", bytes)} } func (_c *MockResponseWriter_Write_Call) Run(run func(bytes []byte)) *MockResponseWriter_Write_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockResponseWriter_Write_Call) Return(n int, err error) *MockResponseWriter_Write_Call { _c.Call.Return(n, err) return _c } func (_c *MockResponseWriter_Write_Call) RunAndReturn(run func(bytes []byte) (int, error)) *MockResponseWriter_Write_Call { _c.Call.Return(run) return _c } // WriteHeader provides a mock function for the type MockResponseWriter func (_mock *MockResponseWriter) WriteHeader(statusCode int) { _mock.Called(statusCode) return } // MockResponseWriter_WriteHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteHeader' type MockResponseWriter_WriteHeader_Call struct { *mock.Call } // WriteHeader is a helper method to define mock.On call // - statusCode int func (_e *MockResponseWriter_Expecter) WriteHeader(statusCode interface{}) *MockResponseWriter_WriteHeader_Call { return &MockResponseWriter_WriteHeader_Call{Call: _e.mock.On("WriteHeader", statusCode)} } func (_c *MockResponseWriter_WriteHeader_Call) Run(run func(statusCode int)) *MockResponseWriter_WriteHeader_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int if args[0] != nil { arg0 = args[0].(int) } run( arg0, ) }) return _c } func (_c *MockResponseWriter_WriteHeader_Call) Return() *MockResponseWriter_WriteHeader_Call { _c.Call.Return() return _c } func (_c *MockResponseWriter_WriteHeader_Call) RunAndReturn(run func(statusCode int)) *MockResponseWriter_WriteHeader_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/mocks_testify_test_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package test import ( "encoding/json" "io" "net/http" "unsafe" mock "github.com/stretchr/testify/mock" http1 "github.com/vektra/mockery/v3/internal/fixtures/12345678/http" "github.com/vektra/mockery/v3/internal/fixtures/constraints" http0 "github.com/vektra/mockery/v3/internal/fixtures/http" "github.com/vektra/mockery/v3/internal/fixtures/redefined_type_b" ) // NewMockUsesAny creates a new instance of MockUsesAny. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockUsesAny(t interface { mock.TestingT Cleanup(func()) }) *MockUsesAny { mock := &MockUsesAny{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockUsesAny is an autogenerated mock type for the UsesAny type type MockUsesAny struct { mock.Mock } type MockUsesAny_Expecter struct { mock *mock.Mock } func (_m *MockUsesAny) EXPECT() *MockUsesAny_Expecter { return &MockUsesAny_Expecter{mock: &_m.Mock} } // GetReader provides a mock function for the type MockUsesAny func (_mock *MockUsesAny) GetReader() any { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetReader") } var r0 any if returnFunc, ok := ret.Get(0).(func() any); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(any) } } return r0 } // MockUsesAny_GetReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReader' type MockUsesAny_GetReader_Call struct { *mock.Call } // GetReader is a helper method to define mock.On call func (_e *MockUsesAny_Expecter) GetReader() *MockUsesAny_GetReader_Call { return &MockUsesAny_GetReader_Call{Call: _e.mock.On("GetReader")} } func (_c *MockUsesAny_GetReader_Call) Run(run func()) *MockUsesAny_GetReader_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockUsesAny_GetReader_Call) Return(v any) *MockUsesAny_GetReader_Call { _c.Call.Return(v) return _c } func (_c *MockUsesAny_GetReader_Call) RunAndReturn(run func() any) *MockUsesAny_GetReader_Call { _c.Call.Return(run) return _c } // NewMockFooer creates a new instance of MockFooer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFooer(t interface { mock.TestingT Cleanup(func()) }) *MockFooer { mock := &MockFooer{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFooer is an autogenerated mock type for the Fooer type type MockFooer struct { mock.Mock } type MockFooer_Expecter struct { mock *mock.Mock } func (_m *MockFooer) EXPECT() *MockFooer_Expecter { return &MockFooer_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockFooer func (_mock *MockFooer) Bar(f func([]int)) { _mock.Called(f) return } // MockFooer_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockFooer_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call // - f func([]int) func (_e *MockFooer_Expecter) Bar(f interface{}) *MockFooer_Bar_Call { return &MockFooer_Bar_Call{Call: _e.mock.On("Bar", f)} } func (_c *MockFooer_Bar_Call) Run(run func(f func([]int))) *MockFooer_Bar_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 func([]int) if args[0] != nil { arg0 = args[0].(func([]int)) } run( arg0, ) }) return _c } func (_c *MockFooer_Bar_Call) Return() *MockFooer_Bar_Call { _c.Call.Return() return _c } func (_c *MockFooer_Bar_Call) RunAndReturn(run func(f func([]int))) *MockFooer_Bar_Call { _c.Run(run) return _c } // Baz provides a mock function for the type MockFooer func (_mock *MockFooer) Baz(path string) func(x string) string { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Baz") } var r0 func(x string) string if returnFunc, ok := ret.Get(0).(func(string) func(x string) string); ok { r0 = returnFunc(path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(func(x string) string) } } return r0 } // MockFooer_Baz_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Baz' type MockFooer_Baz_Call struct { *mock.Call } // Baz is a helper method to define mock.On call // - path string func (_e *MockFooer_Expecter) Baz(path interface{}) *MockFooer_Baz_Call { return &MockFooer_Baz_Call{Call: _e.mock.On("Baz", path)} } func (_c *MockFooer_Baz_Call) Run(run func(path string)) *MockFooer_Baz_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockFooer_Baz_Call) Return(fn func(x string) string) *MockFooer_Baz_Call { _c.Call.Return(fn) return _c } func (_c *MockFooer_Baz_Call) RunAndReturn(run func(path string) func(x string) string) *MockFooer_Baz_Call { _c.Call.Return(run) return _c } // Foo provides a mock function for the type MockFooer func (_mock *MockFooer) Foo(f func(x string) string) error { ret := _mock.Called(f) if len(ret) == 0 { panic("no return value specified for Foo") } var r0 error if returnFunc, ok := ret.Get(0).(func(func(x string) string) error); ok { r0 = returnFunc(f) } else { r0 = ret.Error(0) } return r0 } // MockFooer_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockFooer_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call // - f func(x string) string func (_e *MockFooer_Expecter) Foo(f interface{}) *MockFooer_Foo_Call { return &MockFooer_Foo_Call{Call: _e.mock.On("Foo", f)} } func (_c *MockFooer_Foo_Call) Run(run func(f func(x string) string)) *MockFooer_Foo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 func(x string) string if args[0] != nil { arg0 = args[0].(func(x string) string) } run( arg0, ) }) return _c } func (_c *MockFooer_Foo_Call) Return(err error) *MockFooer_Foo_Call { _c.Call.Return(err) return _c } func (_c *MockFooer_Foo_Call) RunAndReturn(run func(f func(x string) string) error) *MockFooer_Foo_Call { _c.Call.Return(run) return _c } // NewMockMapFunc creates a new instance of MockMapFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockMapFunc(t interface { mock.TestingT Cleanup(func()) }) *MockMapFunc { mock := &MockMapFunc{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockMapFunc is an autogenerated mock type for the MapFunc type type MockMapFunc struct { mock.Mock } type MockMapFunc_Expecter struct { mock *mock.Mock } func (_m *MockMapFunc) EXPECT() *MockMapFunc_Expecter { return &MockMapFunc_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockMapFunc func (_mock *MockMapFunc) Get(m map[string]func(string) string) error { ret := _mock.Called(m) if len(ret) == 0 { panic("no return value specified for Get") } var r0 error if returnFunc, ok := ret.Get(0).(func(map[string]func(string) string) error); ok { r0 = returnFunc(m) } else { r0 = ret.Error(0) } return r0 } // MockMapFunc_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockMapFunc_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - m map[string]func(string) string func (_e *MockMapFunc_Expecter) Get(m interface{}) *MockMapFunc_Get_Call { return &MockMapFunc_Get_Call{Call: _e.mock.On("Get", m)} } func (_c *MockMapFunc_Get_Call) Run(run func(m map[string]func(string) string)) *MockMapFunc_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 map[string]func(string) string if args[0] != nil { arg0 = args[0].(map[string]func(string) string) } run( arg0, ) }) return _c } func (_c *MockMapFunc_Get_Call) Return(err error) *MockMapFunc_Get_Call { _c.Call.Return(err) return _c } func (_c *MockMapFunc_Get_Call) RunAndReturn(run func(m map[string]func(string) string) error) *MockMapFunc_Get_Call { _c.Call.Return(run) return _c } // NewMockAsyncProducer creates a new instance of MockAsyncProducer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockAsyncProducer(t interface { mock.TestingT Cleanup(func()) }) *MockAsyncProducer { mock := &MockAsyncProducer{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockAsyncProducer is an autogenerated mock type for the AsyncProducer type type MockAsyncProducer struct { mock.Mock } type MockAsyncProducer_Expecter struct { mock *mock.Mock } func (_m *MockAsyncProducer) EXPECT() *MockAsyncProducer_Expecter { return &MockAsyncProducer_Expecter{mock: &_m.Mock} } // Input provides a mock function for the type MockAsyncProducer func (_mock *MockAsyncProducer) Input() chan<- bool { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Input") } var r0 chan<- bool if returnFunc, ok := ret.Get(0).(func() chan<- bool); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(chan<- bool) } } return r0 } // MockAsyncProducer_Input_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Input' type MockAsyncProducer_Input_Call struct { *mock.Call } // Input is a helper method to define mock.On call func (_e *MockAsyncProducer_Expecter) Input() *MockAsyncProducer_Input_Call { return &MockAsyncProducer_Input_Call{Call: _e.mock.On("Input")} } func (_c *MockAsyncProducer_Input_Call) Run(run func()) *MockAsyncProducer_Input_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockAsyncProducer_Input_Call) Return(boolCh chan<- bool) *MockAsyncProducer_Input_Call { _c.Call.Return(boolCh) return _c } func (_c *MockAsyncProducer_Input_Call) RunAndReturn(run func() chan<- bool) *MockAsyncProducer_Input_Call { _c.Call.Return(run) return _c } // Output provides a mock function for the type MockAsyncProducer func (_mock *MockAsyncProducer) Output() <-chan bool { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Output") } var r0 <-chan bool if returnFunc, ok := ret.Get(0).(func() <-chan bool); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan bool) } } return r0 } // MockAsyncProducer_Output_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Output' type MockAsyncProducer_Output_Call struct { *mock.Call } // Output is a helper method to define mock.On call func (_e *MockAsyncProducer_Expecter) Output() *MockAsyncProducer_Output_Call { return &MockAsyncProducer_Output_Call{Call: _e.mock.On("Output")} } func (_c *MockAsyncProducer_Output_Call) Run(run func()) *MockAsyncProducer_Output_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockAsyncProducer_Output_Call) Return(boolCh <-chan bool) *MockAsyncProducer_Output_Call { _c.Call.Return(boolCh) return _c } func (_c *MockAsyncProducer_Output_Call) RunAndReturn(run func() <-chan bool) *MockAsyncProducer_Output_Call { _c.Call.Return(run) return _c } // Whatever provides a mock function for the type MockAsyncProducer func (_mock *MockAsyncProducer) Whatever() chan bool { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Whatever") } var r0 chan bool if returnFunc, ok := ret.Get(0).(func() chan bool); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(chan bool) } } return r0 } // MockAsyncProducer_Whatever_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Whatever' type MockAsyncProducer_Whatever_Call struct { *mock.Call } // Whatever is a helper method to define mock.On call func (_e *MockAsyncProducer_Expecter) Whatever() *MockAsyncProducer_Whatever_Call { return &MockAsyncProducer_Whatever_Call{Call: _e.mock.On("Whatever")} } func (_c *MockAsyncProducer_Whatever_Call) Run(run func()) *MockAsyncProducer_Whatever_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockAsyncProducer_Whatever_Call) Return(boolCh chan bool) *MockAsyncProducer_Whatever_Call { _c.Call.Return(boolCh) return _c } func (_c *MockAsyncProducer_Whatever_Call) RunAndReturn(run func() chan bool) *MockAsyncProducer_Whatever_Call { _c.Call.Return(run) return _c } // NewMockConsulLock creates a new instance of MockConsulLock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockConsulLock(t interface { mock.TestingT Cleanup(func()) }) *MockConsulLock { mock := &MockConsulLock{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockConsulLock is an autogenerated mock type for the ConsulLock type type MockConsulLock struct { mock.Mock } type MockConsulLock_Expecter struct { mock *mock.Mock } func (_m *MockConsulLock) EXPECT() *MockConsulLock_Expecter { return &MockConsulLock_Expecter{mock: &_m.Mock} } // Lock provides a mock function for the type MockConsulLock func (_mock *MockConsulLock) Lock(valCh <-chan struct{}) (<-chan struct{}, error) { ret := _mock.Called(valCh) if len(ret) == 0 { panic("no return value specified for Lock") } var r0 <-chan struct{} var r1 error if returnFunc, ok := ret.Get(0).(func(<-chan struct{}) (<-chan struct{}, error)); ok { return returnFunc(valCh) } if returnFunc, ok := ret.Get(0).(func(<-chan struct{}) <-chan struct{}); ok { r0 = returnFunc(valCh) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan struct{}) } } if returnFunc, ok := ret.Get(1).(func(<-chan struct{}) error); ok { r1 = returnFunc(valCh) } else { r1 = ret.Error(1) } return r0, r1 } // MockConsulLock_Lock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Lock' type MockConsulLock_Lock_Call struct { *mock.Call } // Lock is a helper method to define mock.On call // - valCh <-chan struct{} func (_e *MockConsulLock_Expecter) Lock(valCh interface{}) *MockConsulLock_Lock_Call { return &MockConsulLock_Lock_Call{Call: _e.mock.On("Lock", valCh)} } func (_c *MockConsulLock_Lock_Call) Run(run func(valCh <-chan struct{})) *MockConsulLock_Lock_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 <-chan struct{} if args[0] != nil { arg0 = args[0].(<-chan struct{}) } run( arg0, ) }) return _c } func (_c *MockConsulLock_Lock_Call) Return(valCh1 <-chan struct{}, err error) *MockConsulLock_Lock_Call { _c.Call.Return(valCh1, err) return _c } func (_c *MockConsulLock_Lock_Call) RunAndReturn(run func(valCh <-chan struct{}) (<-chan struct{}, error)) *MockConsulLock_Lock_Call { _c.Call.Return(run) return _c } // Unlock provides a mock function for the type MockConsulLock func (_mock *MockConsulLock) Unlock() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Unlock") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockConsulLock_Unlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unlock' type MockConsulLock_Unlock_Call struct { *mock.Call } // Unlock is a helper method to define mock.On call func (_e *MockConsulLock_Expecter) Unlock() *MockConsulLock_Unlock_Call { return &MockConsulLock_Unlock_Call{Call: _e.mock.On("Unlock")} } func (_c *MockConsulLock_Unlock_Call) Run(run func()) *MockConsulLock_Unlock_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockConsulLock_Unlock_Call) Return(err error) *MockConsulLock_Unlock_Call { _c.Call.Return(err) return _c } func (_c *MockConsulLock_Unlock_Call) RunAndReturn(run func() error) *MockConsulLock_Unlock_Call { _c.Call.Return(run) return _c } // NewMockKeyManager creates a new instance of MockKeyManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockKeyManager(t interface { mock.TestingT Cleanup(func()) }) *MockKeyManager { mock := &MockKeyManager{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockKeyManager is an autogenerated mock type for the KeyManager type type MockKeyManager struct { mock.Mock } type MockKeyManager_Expecter struct { mock *mock.Mock } func (_m *MockKeyManager) EXPECT() *MockKeyManager_Expecter { return &MockKeyManager_Expecter{mock: &_m.Mock} } // GetKey provides a mock function for the type MockKeyManager func (_mock *MockKeyManager) GetKey(s string, v uint16) ([]byte, *Err) { ret := _mock.Called(s, v) if len(ret) == 0 { panic("no return value specified for GetKey") } var r0 []byte var r1 *Err if returnFunc, ok := ret.Get(0).(func(string, uint16) ([]byte, *Err)); ok { return returnFunc(s, v) } if returnFunc, ok := ret.Get(0).(func(string, uint16) []byte); ok { r0 = returnFunc(s, v) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]byte) } } if returnFunc, ok := ret.Get(1).(func(string, uint16) *Err); ok { r1 = returnFunc(s, v) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(*Err) } } return r0, r1 } // MockKeyManager_GetKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKey' type MockKeyManager_GetKey_Call struct { *mock.Call } // GetKey is a helper method to define mock.On call // - s string // - v uint16 func (_e *MockKeyManager_Expecter) GetKey(s interface{}, v interface{}) *MockKeyManager_GetKey_Call { return &MockKeyManager_GetKey_Call{Call: _e.mock.On("GetKey", s, v)} } func (_c *MockKeyManager_GetKey_Call) Run(run func(s string, v uint16)) *MockKeyManager_GetKey_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 uint16 if args[1] != nil { arg1 = args[1].(uint16) } run( arg0, arg1, ) }) return _c } func (_c *MockKeyManager_GetKey_Call) Return(bytes []byte, err *Err) *MockKeyManager_GetKey_Call { _c.Call.Return(bytes, err) return _c } func (_c *MockKeyManager_GetKey_Call) RunAndReturn(run func(s string, v uint16) ([]byte, *Err)) *MockKeyManager_GetKey_Call { _c.Call.Return(run) return _c } // NewMockBlank creates a new instance of MockBlank. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockBlank(t interface { mock.TestingT Cleanup(func()) }) *MockBlank { mock := &MockBlank{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockBlank is an autogenerated mock type for the Blank type type MockBlank struct { mock.Mock } type MockBlank_Expecter struct { mock *mock.Mock } func (_m *MockBlank) EXPECT() *MockBlank_Expecter { return &MockBlank_Expecter{mock: &_m.Mock} } // Create provides a mock function for the type MockBlank func (_mock *MockBlank) Create(x interface{}) error { ret := _mock.Called(x) if len(ret) == 0 { panic("no return value specified for Create") } var r0 error if returnFunc, ok := ret.Get(0).(func(interface{}) error); ok { r0 = returnFunc(x) } else { r0 = ret.Error(0) } return r0 } // MockBlank_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' type MockBlank_Create_Call struct { *mock.Call } // Create is a helper method to define mock.On call // - x interface{} func (_e *MockBlank_Expecter) Create(x interface{}) *MockBlank_Create_Call { return &MockBlank_Create_Call{Call: _e.mock.On("Create", x)} } func (_c *MockBlank_Create_Call) Run(run func(x interface{})) *MockBlank_Create_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 interface{} if args[0] != nil { arg0 = args[0].(interface{}) } run( arg0, ) }) return _c } func (_c *MockBlank_Create_Call) Return(err error) *MockBlank_Create_Call { _c.Call.Return(err) return _c } func (_c *MockBlank_Create_Call) RunAndReturn(run func(x interface{}) error) *MockBlank_Create_Call { _c.Call.Return(run) return _c } // NewMockExpecterAndRolledVariadic creates a new instance of MockExpecterAndRolledVariadic. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockExpecterAndRolledVariadic(t interface { mock.TestingT Cleanup(func()) }) *MockExpecterAndRolledVariadic { mock := &MockExpecterAndRolledVariadic{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockExpecterAndRolledVariadic is an autogenerated mock type for the Expecter type type MockExpecterAndRolledVariadic struct { mock.Mock } type MockExpecterAndRolledVariadic_Expecter struct { mock *mock.Mock } func (_m *MockExpecterAndRolledVariadic) EXPECT() *MockExpecterAndRolledVariadic_Expecter { return &MockExpecterAndRolledVariadic_Expecter{mock: &_m.Mock} } // ManyArgsReturns provides a mock function for the type MockExpecterAndRolledVariadic func (_mock *MockExpecterAndRolledVariadic) ManyArgsReturns(str string, i int) ([]string, error) { ret := _mock.Called(str, i) if len(ret) == 0 { panic("no return value specified for ManyArgsReturns") } var r0 []string var r1 error if returnFunc, ok := ret.Get(0).(func(string, int) ([]string, error)); ok { return returnFunc(str, i) } if returnFunc, ok := ret.Get(0).(func(string, int) []string); ok { r0 = returnFunc(str, i) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]string) } } if returnFunc, ok := ret.Get(1).(func(string, int) error); ok { r1 = returnFunc(str, i) } else { r1 = ret.Error(1) } return r0, r1 } // MockExpecterAndRolledVariadic_ManyArgsReturns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ManyArgsReturns' type MockExpecterAndRolledVariadic_ManyArgsReturns_Call struct { *mock.Call } // ManyArgsReturns is a helper method to define mock.On call // - str string // - i int func (_e *MockExpecterAndRolledVariadic_Expecter) ManyArgsReturns(str interface{}, i interface{}) *MockExpecterAndRolledVariadic_ManyArgsReturns_Call { return &MockExpecterAndRolledVariadic_ManyArgsReturns_Call{Call: _e.mock.On("ManyArgsReturns", str, i)} } func (_c *MockExpecterAndRolledVariadic_ManyArgsReturns_Call) Run(run func(str string, i int)) *MockExpecterAndRolledVariadic_ManyArgsReturns_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockExpecterAndRolledVariadic_ManyArgsReturns_Call) Return(strs []string, err error) *MockExpecterAndRolledVariadic_ManyArgsReturns_Call { _c.Call.Return(strs, err) return _c } func (_c *MockExpecterAndRolledVariadic_ManyArgsReturns_Call) RunAndReturn(run func(str string, i int) ([]string, error)) *MockExpecterAndRolledVariadic_ManyArgsReturns_Call { _c.Call.Return(run) return _c } // NoArg provides a mock function for the type MockExpecterAndRolledVariadic func (_mock *MockExpecterAndRolledVariadic) NoArg() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for NoArg") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockExpecterAndRolledVariadic_NoArg_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NoArg' type MockExpecterAndRolledVariadic_NoArg_Call struct { *mock.Call } // NoArg is a helper method to define mock.On call func (_e *MockExpecterAndRolledVariadic_Expecter) NoArg() *MockExpecterAndRolledVariadic_NoArg_Call { return &MockExpecterAndRolledVariadic_NoArg_Call{Call: _e.mock.On("NoArg")} } func (_c *MockExpecterAndRolledVariadic_NoArg_Call) Run(run func()) *MockExpecterAndRolledVariadic_NoArg_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockExpecterAndRolledVariadic_NoArg_Call) Return(s string) *MockExpecterAndRolledVariadic_NoArg_Call { _c.Call.Return(s) return _c } func (_c *MockExpecterAndRolledVariadic_NoArg_Call) RunAndReturn(run func() string) *MockExpecterAndRolledVariadic_NoArg_Call { _c.Call.Return(run) return _c } // NoReturn provides a mock function for the type MockExpecterAndRolledVariadic func (_mock *MockExpecterAndRolledVariadic) NoReturn(str string) { _mock.Called(str) return } // MockExpecterAndRolledVariadic_NoReturn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NoReturn' type MockExpecterAndRolledVariadic_NoReturn_Call struct { *mock.Call } // NoReturn is a helper method to define mock.On call // - str string func (_e *MockExpecterAndRolledVariadic_Expecter) NoReturn(str interface{}) *MockExpecterAndRolledVariadic_NoReturn_Call { return &MockExpecterAndRolledVariadic_NoReturn_Call{Call: _e.mock.On("NoReturn", str)} } func (_c *MockExpecterAndRolledVariadic_NoReturn_Call) Run(run func(str string)) *MockExpecterAndRolledVariadic_NoReturn_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockExpecterAndRolledVariadic_NoReturn_Call) Return() *MockExpecterAndRolledVariadic_NoReturn_Call { _c.Call.Return() return _c } func (_c *MockExpecterAndRolledVariadic_NoReturn_Call) RunAndReturn(run func(str string)) *MockExpecterAndRolledVariadic_NoReturn_Call { _c.Run(run) return _c } // Variadic provides a mock function for the type MockExpecterAndRolledVariadic func (_mock *MockExpecterAndRolledVariadic) Variadic(ints ...int) error { var tmpRet mock.Arguments if len(ints) > 0 { tmpRet = _mock.Called(ints) } else { tmpRet = _mock.Called() } ret := tmpRet if len(ret) == 0 { panic("no return value specified for Variadic") } var r0 error if returnFunc, ok := ret.Get(0).(func(...int) error); ok { r0 = returnFunc(ints...) } else { r0 = ret.Error(0) } return r0 } // MockExpecterAndRolledVariadic_Variadic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Variadic' type MockExpecterAndRolledVariadic_Variadic_Call struct { *mock.Call } // Variadic is a helper method to define mock.On call // - ints ...int func (_e *MockExpecterAndRolledVariadic_Expecter) Variadic(ints ...interface{}) *MockExpecterAndRolledVariadic_Variadic_Call { return &MockExpecterAndRolledVariadic_Variadic_Call{Call: _e.mock.On("Variadic", append([]interface{}{}, ints...)...)} } func (_c *MockExpecterAndRolledVariadic_Variadic_Call) Run(run func(ints ...int)) *MockExpecterAndRolledVariadic_Variadic_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []int var variadicArgs []int if len(args) > 0 { variadicArgs = args[0].([]int) } arg0 = variadicArgs run( arg0..., ) }) return _c } func (_c *MockExpecterAndRolledVariadic_Variadic_Call) Return(err error) *MockExpecterAndRolledVariadic_Variadic_Call { _c.Call.Return(err) return _c } func (_c *MockExpecterAndRolledVariadic_Variadic_Call) RunAndReturn(run func(ints ...int) error) *MockExpecterAndRolledVariadic_Variadic_Call { _c.Call.Return(run) return _c } // VariadicMany provides a mock function for the type MockExpecterAndRolledVariadic func (_mock *MockExpecterAndRolledVariadic) VariadicMany(i int, a string, intfs ...interface{}) error { var tmpRet mock.Arguments if len(intfs) > 0 { tmpRet = _mock.Called(i, a, intfs) } else { tmpRet = _mock.Called(i, a) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for VariadicMany") } var r0 error if returnFunc, ok := ret.Get(0).(func(int, string, ...interface{}) error); ok { r0 = returnFunc(i, a, intfs...) } else { r0 = ret.Error(0) } return r0 } // MockExpecterAndRolledVariadic_VariadicMany_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VariadicMany' type MockExpecterAndRolledVariadic_VariadicMany_Call struct { *mock.Call } // VariadicMany is a helper method to define mock.On call // - i int // - a string // - intfs ...interface{} func (_e *MockExpecterAndRolledVariadic_Expecter) VariadicMany(i interface{}, a interface{}, intfs ...interface{}) *MockExpecterAndRolledVariadic_VariadicMany_Call { return &MockExpecterAndRolledVariadic_VariadicMany_Call{Call: _e.mock.On("VariadicMany", append([]interface{}{i, a}, intfs...)...)} } func (_c *MockExpecterAndRolledVariadic_VariadicMany_Call) Run(run func(i int, a string, intfs ...interface{})) *MockExpecterAndRolledVariadic_VariadicMany_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int if args[0] != nil { arg0 = args[0].(int) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 []interface{} var variadicArgs []interface{} if len(args) > 2 { variadicArgs = args[2].([]interface{}) } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *MockExpecterAndRolledVariadic_VariadicMany_Call) Return(err error) *MockExpecterAndRolledVariadic_VariadicMany_Call { _c.Call.Return(err) return _c } func (_c *MockExpecterAndRolledVariadic_VariadicMany_Call) RunAndReturn(run func(i int, a string, intfs ...interface{}) error) *MockExpecterAndRolledVariadic_VariadicMany_Call { _c.Call.Return(run) return _c } // NewMockExpecter creates a new instance of MockExpecter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockExpecter(t interface { mock.TestingT Cleanup(func()) }) *MockExpecter { mock := &MockExpecter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockExpecter is an autogenerated mock type for the Expecter type type MockExpecter struct { mock.Mock } type MockExpecter_Expecter struct { mock *mock.Mock } func (_m *MockExpecter) EXPECT() *MockExpecter_Expecter { return &MockExpecter_Expecter{mock: &_m.Mock} } // ManyArgsReturns provides a mock function for the type MockExpecter func (_mock *MockExpecter) ManyArgsReturns(str string, i int) ([]string, error) { ret := _mock.Called(str, i) if len(ret) == 0 { panic("no return value specified for ManyArgsReturns") } var r0 []string var r1 error if returnFunc, ok := ret.Get(0).(func(string, int) ([]string, error)); ok { return returnFunc(str, i) } if returnFunc, ok := ret.Get(0).(func(string, int) []string); ok { r0 = returnFunc(str, i) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]string) } } if returnFunc, ok := ret.Get(1).(func(string, int) error); ok { r1 = returnFunc(str, i) } else { r1 = ret.Error(1) } return r0, r1 } // MockExpecter_ManyArgsReturns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ManyArgsReturns' type MockExpecter_ManyArgsReturns_Call struct { *mock.Call } // ManyArgsReturns is a helper method to define mock.On call // - str string // - i int func (_e *MockExpecter_Expecter) ManyArgsReturns(str interface{}, i interface{}) *MockExpecter_ManyArgsReturns_Call { return &MockExpecter_ManyArgsReturns_Call{Call: _e.mock.On("ManyArgsReturns", str, i)} } func (_c *MockExpecter_ManyArgsReturns_Call) Run(run func(str string, i int)) *MockExpecter_ManyArgsReturns_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockExpecter_ManyArgsReturns_Call) Return(strs []string, err error) *MockExpecter_ManyArgsReturns_Call { _c.Call.Return(strs, err) return _c } func (_c *MockExpecter_ManyArgsReturns_Call) RunAndReturn(run func(str string, i int) ([]string, error)) *MockExpecter_ManyArgsReturns_Call { _c.Call.Return(run) return _c } // NoArg provides a mock function for the type MockExpecter func (_mock *MockExpecter) NoArg() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for NoArg") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockExpecter_NoArg_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NoArg' type MockExpecter_NoArg_Call struct { *mock.Call } // NoArg is a helper method to define mock.On call func (_e *MockExpecter_Expecter) NoArg() *MockExpecter_NoArg_Call { return &MockExpecter_NoArg_Call{Call: _e.mock.On("NoArg")} } func (_c *MockExpecter_NoArg_Call) Run(run func()) *MockExpecter_NoArg_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockExpecter_NoArg_Call) Return(s string) *MockExpecter_NoArg_Call { _c.Call.Return(s) return _c } func (_c *MockExpecter_NoArg_Call) RunAndReturn(run func() string) *MockExpecter_NoArg_Call { _c.Call.Return(run) return _c } // NoReturn provides a mock function for the type MockExpecter func (_mock *MockExpecter) NoReturn(str string) { _mock.Called(str) return } // MockExpecter_NoReturn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NoReturn' type MockExpecter_NoReturn_Call struct { *mock.Call } // NoReturn is a helper method to define mock.On call // - str string func (_e *MockExpecter_Expecter) NoReturn(str interface{}) *MockExpecter_NoReturn_Call { return &MockExpecter_NoReturn_Call{Call: _e.mock.On("NoReturn", str)} } func (_c *MockExpecter_NoReturn_Call) Run(run func(str string)) *MockExpecter_NoReturn_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockExpecter_NoReturn_Call) Return() *MockExpecter_NoReturn_Call { _c.Call.Return() return _c } func (_c *MockExpecter_NoReturn_Call) RunAndReturn(run func(str string)) *MockExpecter_NoReturn_Call { _c.Run(run) return _c } // Variadic provides a mock function for the type MockExpecter func (_mock *MockExpecter) Variadic(ints ...int) error { // int _va := make([]interface{}, len(ints)) for _i := range ints { _va[_i] = ints[_i] } var _ca []interface{} _ca = append(_ca, _va...) ret := _mock.Called(_ca...) if len(ret) == 0 { panic("no return value specified for Variadic") } var r0 error if returnFunc, ok := ret.Get(0).(func(...int) error); ok { r0 = returnFunc(ints...) } else { r0 = ret.Error(0) } return r0 } // MockExpecter_Variadic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Variadic' type MockExpecter_Variadic_Call struct { *mock.Call } // Variadic is a helper method to define mock.On call // - ints ...int func (_e *MockExpecter_Expecter) Variadic(ints ...interface{}) *MockExpecter_Variadic_Call { return &MockExpecter_Variadic_Call{Call: _e.mock.On("Variadic", append([]interface{}{}, ints...)...)} } func (_c *MockExpecter_Variadic_Call) Run(run func(ints ...int)) *MockExpecter_Variadic_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []int variadicArgs := make([]int, len(args)-0) for i, a := range args[0:] { if a != nil { variadicArgs[i] = a.(int) } } arg0 = variadicArgs run( arg0..., ) }) return _c } func (_c *MockExpecter_Variadic_Call) Return(err error) *MockExpecter_Variadic_Call { _c.Call.Return(err) return _c } func (_c *MockExpecter_Variadic_Call) RunAndReturn(run func(ints ...int) error) *MockExpecter_Variadic_Call { _c.Call.Return(run) return _c } // VariadicMany provides a mock function for the type MockExpecter func (_mock *MockExpecter) VariadicMany(i int, a string, intfs ...interface{}) error { var _ca []interface{} _ca = append(_ca, i, a) _ca = append(_ca, intfs...) ret := _mock.Called(_ca...) if len(ret) == 0 { panic("no return value specified for VariadicMany") } var r0 error if returnFunc, ok := ret.Get(0).(func(int, string, ...interface{}) error); ok { r0 = returnFunc(i, a, intfs...) } else { r0 = ret.Error(0) } return r0 } // MockExpecter_VariadicMany_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VariadicMany' type MockExpecter_VariadicMany_Call struct { *mock.Call } // VariadicMany is a helper method to define mock.On call // - i int // - a string // - intfs ...interface{} func (_e *MockExpecter_Expecter) VariadicMany(i interface{}, a interface{}, intfs ...interface{}) *MockExpecter_VariadicMany_Call { return &MockExpecter_VariadicMany_Call{Call: _e.mock.On("VariadicMany", append([]interface{}{i, a}, intfs...)...)} } func (_c *MockExpecter_VariadicMany_Call) Run(run func(i int, a string, intfs ...interface{})) *MockExpecter_VariadicMany_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int if args[0] != nil { arg0 = args[0].(int) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 []interface{} variadicArgs := make([]interface{}, len(args)-2) for i, a := range args[2:] { if a != nil { variadicArgs[i] = a.(interface{}) } } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *MockExpecter_VariadicMany_Call) Return(err error) *MockExpecter_VariadicMany_Call { _c.Call.Return(err) return _c } func (_c *MockExpecter_VariadicMany_Call) RunAndReturn(run func(i int, a string, intfs ...interface{}) error) *MockExpecter_VariadicMany_Call { _c.Call.Return(run) return _c } // NewMockVariadicNoReturnInterface creates a new instance of MockVariadicNoReturnInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockVariadicNoReturnInterface(t interface { mock.TestingT Cleanup(func()) }) *MockVariadicNoReturnInterface { mock := &MockVariadicNoReturnInterface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockVariadicNoReturnInterface is an autogenerated mock type for the VariadicNoReturnInterface type type MockVariadicNoReturnInterface struct { mock.Mock } type MockVariadicNoReturnInterface_Expecter struct { mock *mock.Mock } func (_m *MockVariadicNoReturnInterface) EXPECT() *MockVariadicNoReturnInterface_Expecter { return &MockVariadicNoReturnInterface_Expecter{mock: &_m.Mock} } // VariadicNoReturn provides a mock function for the type MockVariadicNoReturnInterface func (_mock *MockVariadicNoReturnInterface) VariadicNoReturn(j int, is ...interface{}) { if len(is) > 0 { _mock.Called(j, is) } else { _mock.Called(j) } return } // MockVariadicNoReturnInterface_VariadicNoReturn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VariadicNoReturn' type MockVariadicNoReturnInterface_VariadicNoReturn_Call struct { *mock.Call } // VariadicNoReturn is a helper method to define mock.On call // - j int // - is ...interface{} func (_e *MockVariadicNoReturnInterface_Expecter) VariadicNoReturn(j interface{}, is ...interface{}) *MockVariadicNoReturnInterface_VariadicNoReturn_Call { return &MockVariadicNoReturnInterface_VariadicNoReturn_Call{Call: _e.mock.On("VariadicNoReturn", append([]interface{}{j}, is...)...)} } func (_c *MockVariadicNoReturnInterface_VariadicNoReturn_Call) Run(run func(j int, is ...interface{})) *MockVariadicNoReturnInterface_VariadicNoReturn_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 int if args[0] != nil { arg0 = args[0].(int) } var arg1 []interface{} var variadicArgs []interface{} if len(args) > 1 { variadicArgs = args[1].([]interface{}) } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockVariadicNoReturnInterface_VariadicNoReturn_Call) Return() *MockVariadicNoReturnInterface_VariadicNoReturn_Call { _c.Call.Return() return _c } func (_c *MockVariadicNoReturnInterface_VariadicNoReturn_Call) RunAndReturn(run func(j int, is ...interface{})) *MockVariadicNoReturnInterface_VariadicNoReturn_Call { _c.Run(run) return _c } // NewMockFuncArgsCollision creates a new instance of MockFuncArgsCollision. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFuncArgsCollision(t interface { mock.TestingT Cleanup(func()) }) *MockFuncArgsCollision { mock := &MockFuncArgsCollision{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFuncArgsCollision is an autogenerated mock type for the FuncArgsCollision type type MockFuncArgsCollision struct { mock.Mock } type MockFuncArgsCollision_Expecter struct { mock *mock.Mock } func (_m *MockFuncArgsCollision) EXPECT() *MockFuncArgsCollision_Expecter { return &MockFuncArgsCollision_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockFuncArgsCollision func (_mock *MockFuncArgsCollision) Foo(ret interface{}) error { ret1 := _mock.Called(ret) if len(ret1) == 0 { panic("no return value specified for Foo") } var r0 error if returnFunc, ok := ret1.Get(0).(func(interface{}) error); ok { r0 = returnFunc(ret) } else { r0 = ret1.Error(0) } return r0 } // MockFuncArgsCollision_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockFuncArgsCollision_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call // - ret interface{} func (_e *MockFuncArgsCollision_Expecter) Foo(ret interface{}) *MockFuncArgsCollision_Foo_Call { return &MockFuncArgsCollision_Foo_Call{Call: _e.mock.On("Foo", ret)} } func (_c *MockFuncArgsCollision_Foo_Call) Run(run func(ret interface{})) *MockFuncArgsCollision_Foo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 interface{} if args[0] != nil { arg0 = args[0].(interface{}) } run( arg0, ) }) return _c } func (_c *MockFuncArgsCollision_Foo_Call) Return(err error) *MockFuncArgsCollision_Foo_Call { _c.Call.Return(err) return _c } func (_c *MockFuncArgsCollision_Foo_Call) RunAndReturn(run func(ret interface{}) error) *MockFuncArgsCollision_Foo_Call { _c.Call.Return(run) return _c } // NewMockRequesterGenerics creates a new instance of MockRequesterGenerics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterGenerics[TAny any, TComparable comparable, TSigned constraints.Signed, TIntf GetInt, TExternalIntf io.Writer, TGenIntf GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface { ~int | GenericType[int, GetInt] comparable }](t interface { mock.TestingT Cleanup(func()) }) *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { mock := &MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterGenerics is an autogenerated mock type for the RequesterGenerics type type MockRequesterGenerics[TAny any, TComparable comparable, TSigned constraints.Signed, TIntf GetInt, TExternalIntf io.Writer, TGenIntf GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface { ~int | GenericType[int, GetInt] comparable }] struct { mock.Mock } type MockRequesterGenerics_Expecter[TAny any, TComparable comparable, TSigned constraints.Signed, TIntf GetInt, TExternalIntf io.Writer, TGenIntf GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface { ~int | GenericType[int, GetInt] comparable }] struct { mock *mock.Mock } func (_m *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) EXPECT() *MockRequesterGenerics_Expecter[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { return &MockRequesterGenerics_Expecter[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]{mock: &_m.Mock} } // GenericAnonymousStructs provides a mock function for the type MockRequesterGenerics func (_mock *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) GenericAnonymousStructs(val struct{ Type1 TExternalIntf }) struct { Type2 GenericType[string, EmbeddedGet[int]] } { ret := _mock.Called(val) if len(ret) == 0 { panic("no return value specified for GenericAnonymousStructs") } var r0 struct { Type2 GenericType[string, EmbeddedGet[int]] } if returnFunc, ok := ret.Get(0).(func(struct{ Type1 TExternalIntf }) struct { Type2 GenericType[string, EmbeddedGet[int]] }); ok { r0 = returnFunc(val) } else { r0 = ret.Get(0).(struct { Type2 GenericType[string, EmbeddedGet[int]] }) } return r0 } // MockRequesterGenerics_GenericAnonymousStructs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenericAnonymousStructs' type MockRequesterGenerics_GenericAnonymousStructs_Call[TAny any, TComparable comparable, TSigned constraints.Signed, TIntf GetInt, TExternalIntf io.Writer, TGenIntf GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface { ~int | GenericType[int, GetInt] comparable }] struct { *mock.Call } // GenericAnonymousStructs is a helper method to define mock.On call // - val struct{Type1 TExternalIntf} func (_e *MockRequesterGenerics_Expecter[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) GenericAnonymousStructs(val interface{}) *MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { return &MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]{Call: _e.mock.On("GenericAnonymousStructs", val)} } func (_c *MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) Run(run func(val struct{ Type1 TExternalIntf })) *MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Run(func(args mock.Arguments) { var arg0 struct{ Type1 TExternalIntf } if args[0] != nil { arg0 = args[0].(struct{ Type1 TExternalIntf }) } run( arg0, ) }) return _c } func (_c *MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) Return(val1 struct { Type2 GenericType[string, EmbeddedGet[int]] }) *MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Return(val1) return _c } func (_c *MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) RunAndReturn(run func(val struct{ Type1 TExternalIntf }) struct { Type2 GenericType[string, EmbeddedGet[int]] }) *MockRequesterGenerics_GenericAnonymousStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Return(run) return _c } // GenericArguments provides a mock function for the type MockRequesterGenerics func (_mock *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) GenericArguments(v TAny, v1 TComparable) (TSigned, TIntf) { ret := _mock.Called(v, v1) if len(ret) == 0 { panic("no return value specified for GenericArguments") } var r0 TSigned var r1 TIntf if returnFunc, ok := ret.Get(0).(func(TAny, TComparable) (TSigned, TIntf)); ok { return returnFunc(v, v1) } if returnFunc, ok := ret.Get(0).(func(TAny, TComparable) TSigned); ok { r0 = returnFunc(v, v1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(TSigned) } } if returnFunc, ok := ret.Get(1).(func(TAny, TComparable) TIntf); ok { r1 = returnFunc(v, v1) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(TIntf) } } return r0, r1 } // MockRequesterGenerics_GenericArguments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenericArguments' type MockRequesterGenerics_GenericArguments_Call[TAny any, TComparable comparable, TSigned constraints.Signed, TIntf GetInt, TExternalIntf io.Writer, TGenIntf GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface { ~int | GenericType[int, GetInt] comparable }] struct { *mock.Call } // GenericArguments is a helper method to define mock.On call // - v TAny // - v1 TComparable func (_e *MockRequesterGenerics_Expecter[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) GenericArguments(v interface{}, v1 interface{}) *MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { return &MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]{Call: _e.mock.On("GenericArguments", v, v1)} } func (_c *MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) Run(run func(v TAny, v1 TComparable)) *MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Run(func(args mock.Arguments) { var arg0 TAny if args[0] != nil { arg0 = args[0].(TAny) } var arg1 TComparable if args[1] != nil { arg1 = args[1].(TComparable) } run( arg0, arg1, ) }) return _c } func (_c *MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) Return(v2 TSigned, v3 TIntf) *MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Return(v2, v3) return _c } func (_c *MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) RunAndReturn(run func(v TAny, v1 TComparable) (TSigned, TIntf)) *MockRequesterGenerics_GenericArguments_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Return(run) return _c } // GenericStructs provides a mock function for the type MockRequesterGenerics func (_mock *MockRequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) GenericStructs(genericType GenericType[TAny, TIntf]) GenericType[TSigned, TIntf] { ret := _mock.Called(genericType) if len(ret) == 0 { panic("no return value specified for GenericStructs") } var r0 GenericType[TSigned, TIntf] if returnFunc, ok := ret.Get(0).(func(GenericType[TAny, TIntf]) GenericType[TSigned, TIntf]); ok { r0 = returnFunc(genericType) } else { r0 = ret.Get(0).(GenericType[TSigned, TIntf]) } return r0 } // MockRequesterGenerics_GenericStructs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenericStructs' type MockRequesterGenerics_GenericStructs_Call[TAny any, TComparable comparable, TSigned constraints.Signed, TIntf GetInt, TExternalIntf io.Writer, TGenIntf GetGeneric[TSigned], TInlineType interface{ ~int | ~uint }, TInlineTypeGeneric interface { ~int | GenericType[int, GetInt] comparable }] struct { *mock.Call } // GenericStructs is a helper method to define mock.On call // - genericType GenericType[TAny, TIntf] func (_e *MockRequesterGenerics_Expecter[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) GenericStructs(genericType interface{}) *MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { return &MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]{Call: _e.mock.On("GenericStructs", genericType)} } func (_c *MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) Run(run func(genericType GenericType[TAny, TIntf])) *MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Run(func(args mock.Arguments) { var arg0 GenericType[TAny, TIntf] if args[0] != nil { arg0 = args[0].(GenericType[TAny, TIntf]) } run( arg0, ) }) return _c } func (_c *MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) Return(genericType1 GenericType[TSigned, TIntf]) *MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Return(genericType1) return _c } func (_c *MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric]) RunAndReturn(run func(genericType GenericType[TAny, TIntf]) GenericType[TSigned, TIntf]) *MockRequesterGenerics_GenericStructs_Call[TAny, TComparable, TSigned, TIntf, TExternalIntf, TGenIntf, TInlineType, TInlineTypeGeneric] { _c.Call.Return(run) return _c } // NewMockGetInt creates a new instance of MockGetInt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockGetInt(t interface { mock.TestingT Cleanup(func()) }) *MockGetInt { mock := &MockGetInt{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockGetInt is an autogenerated mock type for the GetInt type type MockGetInt struct { mock.Mock } type MockGetInt_Expecter struct { mock *mock.Mock } func (_m *MockGetInt) EXPECT() *MockGetInt_Expecter { return &MockGetInt_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockGetInt func (_mock *MockGetInt) Get() int { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 int if returnFunc, ok := ret.Get(0).(func() int); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(int) } return r0 } // MockGetInt_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockGetInt_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockGetInt_Expecter) Get() *MockGetInt_Get_Call { return &MockGetInt_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockGetInt_Get_Call) Run(run func()) *MockGetInt_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockGetInt_Get_Call) Return(n int) *MockGetInt_Get_Call { _c.Call.Return(n) return _c } func (_c *MockGetInt_Get_Call) RunAndReturn(run func() int) *MockGetInt_Get_Call { _c.Call.Return(run) return _c } // NewMockGetGeneric creates a new instance of MockGetGeneric. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockGetGeneric[T constraints.Integer](t interface { mock.TestingT Cleanup(func()) }) *MockGetGeneric[T] { mock := &MockGetGeneric[T]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockGetGeneric is an autogenerated mock type for the GetGeneric type type MockGetGeneric[T constraints.Integer] struct { mock.Mock } type MockGetGeneric_Expecter[T constraints.Integer] struct { mock *mock.Mock } func (_m *MockGetGeneric[T]) EXPECT() *MockGetGeneric_Expecter[T] { return &MockGetGeneric_Expecter[T]{mock: &_m.Mock} } // Get provides a mock function for the type MockGetGeneric func (_mock *MockGetGeneric[T]) Get() T { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 T if returnFunc, ok := ret.Get(0).(func() T); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(T) } } return r0 } // MockGetGeneric_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockGetGeneric_Get_Call[T constraints.Integer] struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockGetGeneric_Expecter[T]) Get() *MockGetGeneric_Get_Call[T] { return &MockGetGeneric_Get_Call[T]{Call: _e.mock.On("Get")} } func (_c *MockGetGeneric_Get_Call[T]) Run(run func()) *MockGetGeneric_Get_Call[T] { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockGetGeneric_Get_Call[T]) Return(v T) *MockGetGeneric_Get_Call[T] { _c.Call.Return(v) return _c } func (_c *MockGetGeneric_Get_Call[T]) RunAndReturn(run func() T) *MockGetGeneric_Get_Call[T] { _c.Call.Return(run) return _c } // NewMockEmbeddedGet creates a new instance of MockEmbeddedGet. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockEmbeddedGet[T constraints.Signed](t interface { mock.TestingT Cleanup(func()) }) *MockEmbeddedGet[T] { mock := &MockEmbeddedGet[T]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockEmbeddedGet is an autogenerated mock type for the EmbeddedGet type type MockEmbeddedGet[T constraints.Signed] struct { mock.Mock } type MockEmbeddedGet_Expecter[T constraints.Signed] struct { mock *mock.Mock } func (_m *MockEmbeddedGet[T]) EXPECT() *MockEmbeddedGet_Expecter[T] { return &MockEmbeddedGet_Expecter[T]{mock: &_m.Mock} } // Get provides a mock function for the type MockEmbeddedGet func (_mock *MockEmbeddedGet[T]) Get() T { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 T if returnFunc, ok := ret.Get(0).(func() T); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(T) } } return r0 } // MockEmbeddedGet_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockEmbeddedGet_Get_Call[T constraints.Signed] struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockEmbeddedGet_Expecter[T]) Get() *MockEmbeddedGet_Get_Call[T] { return &MockEmbeddedGet_Get_Call[T]{Call: _e.mock.On("Get")} } func (_c *MockEmbeddedGet_Get_Call[T]) Run(run func()) *MockEmbeddedGet_Get_Call[T] { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockEmbeddedGet_Get_Call[T]) Return(v T) *MockEmbeddedGet_Get_Call[T] { _c.Call.Return(v) return _c } func (_c *MockEmbeddedGet_Get_Call[T]) RunAndReturn(run func() T) *MockEmbeddedGet_Get_Call[T] { _c.Call.Return(run) return _c } // NewMockReplaceGeneric creates a new instance of MockReplaceGeneric. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReplaceGeneric[TImport any, TConstraint constraints.Signed, TKeep any](t interface { mock.TestingT Cleanup(func()) }) *MockReplaceGeneric[TImport, TConstraint, TKeep] { mock := &MockReplaceGeneric[TImport, TConstraint, TKeep]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReplaceGeneric is an autogenerated mock type for the ReplaceGeneric type type MockReplaceGeneric[TImport any, TConstraint constraints.Signed, TKeep any] struct { mock.Mock } type MockReplaceGeneric_Expecter[TImport any, TConstraint constraints.Signed, TKeep any] struct { mock *mock.Mock } func (_m *MockReplaceGeneric[TImport, TConstraint, TKeep]) EXPECT() *MockReplaceGeneric_Expecter[TImport, TConstraint, TKeep] { return &MockReplaceGeneric_Expecter[TImport, TConstraint, TKeep]{mock: &_m.Mock} } // A provides a mock function for the type MockReplaceGeneric func (_mock *MockReplaceGeneric[TImport, TConstraint, TKeep]) A(t1 TImport) TKeep { ret := _mock.Called(t1) if len(ret) == 0 { panic("no return value specified for A") } var r0 TKeep if returnFunc, ok := ret.Get(0).(func(TImport) TKeep); ok { r0 = returnFunc(t1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(TKeep) } } return r0 } // MockReplaceGeneric_A_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'A' type MockReplaceGeneric_A_Call[TImport any, TConstraint constraints.Signed, TKeep any] struct { *mock.Call } // A is a helper method to define mock.On call // - t1 TImport func (_e *MockReplaceGeneric_Expecter[TImport, TConstraint, TKeep]) A(t1 interface{}) *MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep] { return &MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep]{Call: _e.mock.On("A", t1)} } func (_c *MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep]) Run(run func(t1 TImport)) *MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep] { _c.Call.Run(func(args mock.Arguments) { var arg0 TImport if args[0] != nil { arg0 = args[0].(TImport) } run( arg0, ) }) return _c } func (_c *MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep]) Return(v TKeep) *MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep] { _c.Call.Return(v) return _c } func (_c *MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep]) RunAndReturn(run func(t1 TImport) TKeep) *MockReplaceGeneric_A_Call[TImport, TConstraint, TKeep] { _c.Call.Return(run) return _c } // B provides a mock function for the type MockReplaceGeneric func (_mock *MockReplaceGeneric[TImport, TConstraint, TKeep]) B() TImport { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for B") } var r0 TImport if returnFunc, ok := ret.Get(0).(func() TImport); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(TImport) } } return r0 } // MockReplaceGeneric_B_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'B' type MockReplaceGeneric_B_Call[TImport any, TConstraint constraints.Signed, TKeep any] struct { *mock.Call } // B is a helper method to define mock.On call func (_e *MockReplaceGeneric_Expecter[TImport, TConstraint, TKeep]) B() *MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep] { return &MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep]{Call: _e.mock.On("B")} } func (_c *MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep]) Run(run func()) *MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep] { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep]) Return(v TImport) *MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep] { _c.Call.Return(v) return _c } func (_c *MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep]) RunAndReturn(run func() TImport) *MockReplaceGeneric_B_Call[TImport, TConstraint, TKeep] { _c.Call.Return(run) return _c } // C provides a mock function for the type MockReplaceGeneric func (_mock *MockReplaceGeneric[TImport, TConstraint, TKeep]) C() TConstraint { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for C") } var r0 TConstraint if returnFunc, ok := ret.Get(0).(func() TConstraint); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(TConstraint) } } return r0 } // MockReplaceGeneric_C_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'C' type MockReplaceGeneric_C_Call[TImport any, TConstraint constraints.Signed, TKeep any] struct { *mock.Call } // C is a helper method to define mock.On call func (_e *MockReplaceGeneric_Expecter[TImport, TConstraint, TKeep]) C() *MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep] { return &MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep]{Call: _e.mock.On("C")} } func (_c *MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep]) Run(run func()) *MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep] { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep]) Return(v TConstraint) *MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep] { _c.Call.Return(v) return _c } func (_c *MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep]) RunAndReturn(run func() TConstraint) *MockReplaceGeneric_C_Call[TImport, TConstraint, TKeep] { _c.Call.Return(run) return _c } // NewMockReplaceGenericSelf creates a new instance of MockReplaceGenericSelf. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockReplaceGenericSelf[T any](t interface { mock.TestingT Cleanup(func()) }) *MockReplaceGenericSelf[T] { mock := &MockReplaceGenericSelf[T]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockReplaceGenericSelf is an autogenerated mock type for the ReplaceGenericSelf type type MockReplaceGenericSelf[T any] struct { mock.Mock } type MockReplaceGenericSelf_Expecter[T any] struct { mock *mock.Mock } func (_m *MockReplaceGenericSelf[T]) EXPECT() *MockReplaceGenericSelf_Expecter[T] { return &MockReplaceGenericSelf_Expecter[T]{mock: &_m.Mock} } // A provides a mock function for the type MockReplaceGenericSelf func (_mock *MockReplaceGenericSelf[T]) A() T { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for A") } var r0 T if returnFunc, ok := ret.Get(0).(func() T); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(T) } } return r0 } // MockReplaceGenericSelf_A_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'A' type MockReplaceGenericSelf_A_Call[T any] struct { *mock.Call } // A is a helper method to define mock.On call func (_e *MockReplaceGenericSelf_Expecter[T]) A() *MockReplaceGenericSelf_A_Call[T] { return &MockReplaceGenericSelf_A_Call[T]{Call: _e.mock.On("A")} } func (_c *MockReplaceGenericSelf_A_Call[T]) Run(run func()) *MockReplaceGenericSelf_A_Call[T] { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockReplaceGenericSelf_A_Call[T]) Return(v T) *MockReplaceGenericSelf_A_Call[T] { _c.Call.Return(v) return _c } func (_c *MockReplaceGenericSelf_A_Call[T]) RunAndReturn(run func() T) *MockReplaceGenericSelf_A_Call[T] { _c.Call.Return(run) return _c } // NewMockHasConflictingNestedImports creates a new instance of MockHasConflictingNestedImports. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockHasConflictingNestedImports(t interface { mock.TestingT Cleanup(func()) }) *MockHasConflictingNestedImports { mock := &MockHasConflictingNestedImports{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockHasConflictingNestedImports is an autogenerated mock type for the HasConflictingNestedImports type type MockHasConflictingNestedImports struct { mock.Mock } type MockHasConflictingNestedImports_Expecter struct { mock *mock.Mock } func (_m *MockHasConflictingNestedImports) EXPECT() *MockHasConflictingNestedImports_Expecter { return &MockHasConflictingNestedImports_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockHasConflictingNestedImports func (_mock *MockHasConflictingNestedImports) Get(path string) (http.Response, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 http.Response var r1 error if returnFunc, ok := ret.Get(0).(func(string) (http.Response, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) http.Response); ok { r0 = returnFunc(path) } else { r0 = ret.Get(0).(http.Response) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockHasConflictingNestedImports_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockHasConflictingNestedImports_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockHasConflictingNestedImports_Expecter) Get(path interface{}) *MockHasConflictingNestedImports_Get_Call { return &MockHasConflictingNestedImports_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockHasConflictingNestedImports_Get_Call) Run(run func(path string)) *MockHasConflictingNestedImports_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockHasConflictingNestedImports_Get_Call) Return(response http.Response, err error) *MockHasConflictingNestedImports_Get_Call { _c.Call.Return(response, err) return _c } func (_c *MockHasConflictingNestedImports_Get_Call) RunAndReturn(run func(path string) (http.Response, error)) *MockHasConflictingNestedImports_Get_Call { _c.Call.Return(run) return _c } // Z provides a mock function for the type MockHasConflictingNestedImports func (_mock *MockHasConflictingNestedImports) Z() http0.MyStruct { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Z") } var r0 http0.MyStruct if returnFunc, ok := ret.Get(0).(func() http0.MyStruct); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(http0.MyStruct) } return r0 } // MockHasConflictingNestedImports_Z_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Z' type MockHasConflictingNestedImports_Z_Call struct { *mock.Call } // Z is a helper method to define mock.On call func (_e *MockHasConflictingNestedImports_Expecter) Z() *MockHasConflictingNestedImports_Z_Call { return &MockHasConflictingNestedImports_Z_Call{Call: _e.mock.On("Z")} } func (_c *MockHasConflictingNestedImports_Z_Call) Run(run func()) *MockHasConflictingNestedImports_Z_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockHasConflictingNestedImports_Z_Call) Return(myStruct http0.MyStruct) *MockHasConflictingNestedImports_Z_Call { _c.Call.Return(myStruct) return _c } func (_c *MockHasConflictingNestedImports_Z_Call) RunAndReturn(run func() http0.MyStruct) *MockHasConflictingNestedImports_Z_Call { _c.Call.Return(run) return _c } // NewMockImportsSameAsPackage creates a new instance of MockImportsSameAsPackage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockImportsSameAsPackage(t interface { mock.TestingT Cleanup(func()) }) *MockImportsSameAsPackage { mock := &MockImportsSameAsPackage{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockImportsSameAsPackage is an autogenerated mock type for the ImportsSameAsPackage type type MockImportsSameAsPackage struct { mock.Mock } type MockImportsSameAsPackage_Expecter struct { mock *mock.Mock } func (_m *MockImportsSameAsPackage) EXPECT() *MockImportsSameAsPackage_Expecter { return &MockImportsSameAsPackage_Expecter{mock: &_m.Mock} } // A provides a mock function for the type MockImportsSameAsPackage func (_mock *MockImportsSameAsPackage) A() test.B { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for A") } var r0 test.B if returnFunc, ok := ret.Get(0).(func() test.B); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(test.B) } return r0 } // MockImportsSameAsPackage_A_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'A' type MockImportsSameAsPackage_A_Call struct { *mock.Call } // A is a helper method to define mock.On call func (_e *MockImportsSameAsPackage_Expecter) A() *MockImportsSameAsPackage_A_Call { return &MockImportsSameAsPackage_A_Call{Call: _e.mock.On("A")} } func (_c *MockImportsSameAsPackage_A_Call) Run(run func()) *MockImportsSameAsPackage_A_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockImportsSameAsPackage_A_Call) Return(b test.B) *MockImportsSameAsPackage_A_Call { _c.Call.Return(b) return _c } func (_c *MockImportsSameAsPackage_A_Call) RunAndReturn(run func() test.B) *MockImportsSameAsPackage_A_Call { _c.Call.Return(run) return _c } // B provides a mock function for the type MockImportsSameAsPackage func (_mock *MockImportsSameAsPackage) B() KeyManager { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for B") } var r0 KeyManager if returnFunc, ok := ret.Get(0).(func() KeyManager); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(KeyManager) } } return r0 } // MockImportsSameAsPackage_B_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'B' type MockImportsSameAsPackage_B_Call struct { *mock.Call } // B is a helper method to define mock.On call func (_e *MockImportsSameAsPackage_Expecter) B() *MockImportsSameAsPackage_B_Call { return &MockImportsSameAsPackage_B_Call{Call: _e.mock.On("B")} } func (_c *MockImportsSameAsPackage_B_Call) Run(run func()) *MockImportsSameAsPackage_B_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockImportsSameAsPackage_B_Call) Return(keyManager KeyManager) *MockImportsSameAsPackage_B_Call { _c.Call.Return(keyManager) return _c } func (_c *MockImportsSameAsPackage_B_Call) RunAndReturn(run func() KeyManager) *MockImportsSameAsPackage_B_Call { _c.Call.Return(run) return _c } // C provides a mock function for the type MockImportsSameAsPackage func (_mock *MockImportsSameAsPackage) C(c C) { _mock.Called(c) return } // MockImportsSameAsPackage_C_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'C' type MockImportsSameAsPackage_C_Call struct { *mock.Call } // C is a helper method to define mock.On call // - c C func (_e *MockImportsSameAsPackage_Expecter) C(c interface{}) *MockImportsSameAsPackage_C_Call { return &MockImportsSameAsPackage_C_Call{Call: _e.mock.On("C", c)} } func (_c *MockImportsSameAsPackage_C_Call) Run(run func(c C)) *MockImportsSameAsPackage_C_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 C if args[0] != nil { arg0 = args[0].(C) } run( arg0, ) }) return _c } func (_c *MockImportsSameAsPackage_C_Call) Return() *MockImportsSameAsPackage_C_Call { _c.Call.Return() return _c } func (_c *MockImportsSameAsPackage_C_Call) RunAndReturn(run func(c C)) *MockImportsSameAsPackage_C_Call { _c.Run(run) return _c } // NewMockGenericInterface creates a new instance of MockGenericInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockGenericInterface[M any](t interface { mock.TestingT Cleanup(func()) }) *MockGenericInterface[M] { mock := &MockGenericInterface[M]{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockGenericInterface is an autogenerated mock type for the GenericInterface type type MockGenericInterface[M any] struct { mock.Mock } type MockGenericInterface_Expecter[M any] struct { mock *mock.Mock } func (_m *MockGenericInterface[M]) EXPECT() *MockGenericInterface_Expecter[M] { return &MockGenericInterface_Expecter[M]{mock: &_m.Mock} } // Func provides a mock function for the type MockGenericInterface func (_mock *MockGenericInterface[M]) Func(arg *M) int { ret := _mock.Called(arg) if len(ret) == 0 { panic("no return value specified for Func") } var r0 int if returnFunc, ok := ret.Get(0).(func(*M) int); ok { r0 = returnFunc(arg) } else { r0 = ret.Get(0).(int) } return r0 } // MockGenericInterface_Func_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Func' type MockGenericInterface_Func_Call[M any] struct { *mock.Call } // Func is a helper method to define mock.On call // - arg *M func (_e *MockGenericInterface_Expecter[M]) Func(arg interface{}) *MockGenericInterface_Func_Call[M] { return &MockGenericInterface_Func_Call[M]{Call: _e.mock.On("Func", arg)} } func (_c *MockGenericInterface_Func_Call[M]) Run(run func(arg *M)) *MockGenericInterface_Func_Call[M] { _c.Call.Run(func(args mock.Arguments) { var arg0 *M if args[0] != nil { arg0 = args[0].(*M) } run( arg0, ) }) return _c } func (_c *MockGenericInterface_Func_Call[M]) Return(n int) *MockGenericInterface_Func_Call[M] { _c.Call.Return(n) return _c } func (_c *MockGenericInterface_Func_Call[M]) RunAndReturn(run func(arg *M) int) *MockGenericInterface_Func_Call[M] { _c.Call.Return(run) return _c } // NewMockInstantiatedGenericInterface creates a new instance of MockInstantiatedGenericInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockInstantiatedGenericInterface(t interface { mock.TestingT Cleanup(func()) }) *MockInstantiatedGenericInterface { mock := &MockInstantiatedGenericInterface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockInstantiatedGenericInterface is an autogenerated mock type for the InstantiatedGenericInterface type type MockInstantiatedGenericInterface struct { mock.Mock } type MockInstantiatedGenericInterface_Expecter struct { mock *mock.Mock } func (_m *MockInstantiatedGenericInterface) EXPECT() *MockInstantiatedGenericInterface_Expecter { return &MockInstantiatedGenericInterface_Expecter{mock: &_m.Mock} } // Func provides a mock function for the type MockInstantiatedGenericInterface func (_mock *MockInstantiatedGenericInterface) Func(arg *float32) int { ret := _mock.Called(arg) if len(ret) == 0 { panic("no return value specified for Func") } var r0 int if returnFunc, ok := ret.Get(0).(func(*float32) int); ok { r0 = returnFunc(arg) } else { r0 = ret.Get(0).(int) } return r0 } // MockInstantiatedGenericInterface_Func_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Func' type MockInstantiatedGenericInterface_Func_Call struct { *mock.Call } // Func is a helper method to define mock.On call // - arg *float32 func (_e *MockInstantiatedGenericInterface_Expecter) Func(arg interface{}) *MockInstantiatedGenericInterface_Func_Call { return &MockInstantiatedGenericInterface_Func_Call{Call: _e.mock.On("Func", arg)} } func (_c *MockInstantiatedGenericInterface_Func_Call) Run(run func(arg *float32)) *MockInstantiatedGenericInterface_Func_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 *float32 if args[0] != nil { arg0 = args[0].(*float32) } run( arg0, ) }) return _c } func (_c *MockInstantiatedGenericInterface_Func_Call) Return(n int) *MockInstantiatedGenericInterface_Func_Call { _c.Call.Return(n) return _c } func (_c *MockInstantiatedGenericInterface_Func_Call) RunAndReturn(run func(arg *float32) int) *MockInstantiatedGenericInterface_Func_Call { _c.Call.Return(run) return _c } // NewMockMyReader creates a new instance of MockMyReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockMyReader(t interface { mock.TestingT Cleanup(func()) }) *MockMyReader { mock := &MockMyReader{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockMyReader is an autogenerated mock type for the MyReader type type MockMyReader struct { mock.Mock } type MockMyReader_Expecter struct { mock *mock.Mock } func (_m *MockMyReader) EXPECT() *MockMyReader_Expecter { return &MockMyReader_Expecter{mock: &_m.Mock} } // Read provides a mock function for the type MockMyReader func (_mock *MockMyReader) Read(p []byte) (int, error) { ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for Read") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok { return returnFunc(p) } if returnFunc, ok := ret.Get(0).(func([]byte) int); ok { r0 = returnFunc(p) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { r1 = returnFunc(p) } else { r1 = ret.Error(1) } return r0, r1 } // MockMyReader_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' type MockMyReader_Read_Call struct { *mock.Call } // Read is a helper method to define mock.On call // - p []byte func (_e *MockMyReader_Expecter) Read(p interface{}) *MockMyReader_Read_Call { return &MockMyReader_Read_Call{Call: _e.mock.On("Read", p)} } func (_c *MockMyReader_Read_Call) Run(run func(p []byte)) *MockMyReader_Read_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []byte if args[0] != nil { arg0 = args[0].([]byte) } run( arg0, ) }) return _c } func (_c *MockMyReader_Read_Call) Return(n int, err error) *MockMyReader_Read_Call { _c.Call.Return(n, err) return _c } func (_c *MockMyReader_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockMyReader_Read_Call { _c.Call.Return(run) return _c } // NewMockIssue766 creates a new instance of MockIssue766. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockIssue766(t interface { mock.TestingT Cleanup(func()) }) *MockIssue766 { mock := &MockIssue766{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockIssue766 is an autogenerated mock type for the Issue766 type type MockIssue766 struct { mock.Mock } type MockIssue766_Expecter struct { mock *mock.Mock } func (_m *MockIssue766) EXPECT() *MockIssue766_Expecter { return &MockIssue766_Expecter{mock: &_m.Mock} } // FetchData provides a mock function for the type MockIssue766 func (_mock *MockIssue766) FetchData(fetchFunc func(x ...int) ([]int, error)) ([]int, error) { ret := _mock.Called(fetchFunc) if len(ret) == 0 { panic("no return value specified for FetchData") } var r0 []int var r1 error if returnFunc, ok := ret.Get(0).(func(func(x ...int) ([]int, error)) ([]int, error)); ok { return returnFunc(fetchFunc) } if returnFunc, ok := ret.Get(0).(func(func(x ...int) ([]int, error)) []int); ok { r0 = returnFunc(fetchFunc) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]int) } } if returnFunc, ok := ret.Get(1).(func(func(x ...int) ([]int, error)) error); ok { r1 = returnFunc(fetchFunc) } else { r1 = ret.Error(1) } return r0, r1 } // MockIssue766_FetchData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchData' type MockIssue766_FetchData_Call struct { *mock.Call } // FetchData is a helper method to define mock.On call // - fetchFunc func(x ...int) ([]int, error) func (_e *MockIssue766_Expecter) FetchData(fetchFunc interface{}) *MockIssue766_FetchData_Call { return &MockIssue766_FetchData_Call{Call: _e.mock.On("FetchData", fetchFunc)} } func (_c *MockIssue766_FetchData_Call) Run(run func(fetchFunc func(x ...int) ([]int, error))) *MockIssue766_FetchData_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 func(x ...int) ([]int, error) if args[0] != nil { arg0 = args[0].(func(x ...int) ([]int, error)) } run( arg0, ) }) return _c } func (_c *MockIssue766_FetchData_Call) Return(ints []int, err error) *MockIssue766_FetchData_Call { _c.Call.Return(ints, err) return _c } func (_c *MockIssue766_FetchData_Call) RunAndReturn(run func(fetchFunc func(x ...int) ([]int, error)) ([]int, error)) *MockIssue766_FetchData_Call { _c.Call.Return(run) return _c } // NewMockMapToInterface creates a new instance of MockMapToInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockMapToInterface(t interface { mock.TestingT Cleanup(func()) }) *MockMapToInterface { mock := &MockMapToInterface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockMapToInterface is an autogenerated mock type for the MapToInterface type type MockMapToInterface struct { mock.Mock } type MockMapToInterface_Expecter struct { mock *mock.Mock } func (_m *MockMapToInterface) EXPECT() *MockMapToInterface_Expecter { return &MockMapToInterface_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockMapToInterface func (_mock *MockMapToInterface) Foo(arg1 ...map[string]interface{}) { if len(arg1) > 0 { _mock.Called(arg1) } else { _mock.Called() } return } // MockMapToInterface_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockMapToInterface_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call // - arg1 ...map[string]interface{} func (_e *MockMapToInterface_Expecter) Foo(arg1 ...interface{}) *MockMapToInterface_Foo_Call { return &MockMapToInterface_Foo_Call{Call: _e.mock.On("Foo", append([]interface{}{}, arg1...)...)} } func (_c *MockMapToInterface_Foo_Call) Run(run func(arg1 ...map[string]interface{})) *MockMapToInterface_Foo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []map[string]interface{} var variadicArgs []map[string]interface{} if len(args) > 0 { variadicArgs = args[0].([]map[string]interface{}) } arg0 = variadicArgs run( arg0..., ) }) return _c } func (_c *MockMapToInterface_Foo_Call) Return() *MockMapToInterface_Foo_Call { _c.Call.Return() return _c } func (_c *MockMapToInterface_Foo_Call) RunAndReturn(run func(arg1 ...map[string]interface{})) *MockMapToInterface_Foo_Call { _c.Run(run) return _c } // NewMockSibling creates a new instance of MockSibling. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockSibling(t interface { mock.TestingT Cleanup(func()) }) *MockSibling { mock := &MockSibling{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockSibling is an autogenerated mock type for the Sibling type type MockSibling struct { mock.Mock } type MockSibling_Expecter struct { mock *mock.Mock } func (_m *MockSibling) EXPECT() *MockSibling_Expecter { return &MockSibling_Expecter{mock: &_m.Mock} } // DoSomething provides a mock function for the type MockSibling func (_mock *MockSibling) DoSomething() { _mock.Called() return } // MockSibling_DoSomething_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoSomething' type MockSibling_DoSomething_Call struct { *mock.Call } // DoSomething is a helper method to define mock.On call func (_e *MockSibling_Expecter) DoSomething() *MockSibling_DoSomething_Call { return &MockSibling_DoSomething_Call{Call: _e.mock.On("DoSomething")} } func (_c *MockSibling_DoSomething_Call) Run(run func()) *MockSibling_DoSomething_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockSibling_DoSomething_Call) Return() *MockSibling_DoSomething_Call { _c.Call.Return() return _c } func (_c *MockSibling_DoSomething_Call) RunAndReturn(run func()) *MockSibling_DoSomething_Call { _c.Run(run) return _c } // NewMockUsesOtherPkgIface creates a new instance of MockUsesOtherPkgIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockUsesOtherPkgIface(t interface { mock.TestingT Cleanup(func()) }) *MockUsesOtherPkgIface { mock := &MockUsesOtherPkgIface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockUsesOtherPkgIface is an autogenerated mock type for the UsesOtherPkgIface type type MockUsesOtherPkgIface struct { mock.Mock } type MockUsesOtherPkgIface_Expecter struct { mock *mock.Mock } func (_m *MockUsesOtherPkgIface) EXPECT() *MockUsesOtherPkgIface_Expecter { return &MockUsesOtherPkgIface_Expecter{mock: &_m.Mock} } // DoSomethingElse provides a mock function for the type MockUsesOtherPkgIface func (_mock *MockUsesOtherPkgIface) DoSomethingElse(obj Sibling) { _mock.Called(obj) return } // MockUsesOtherPkgIface_DoSomethingElse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoSomethingElse' type MockUsesOtherPkgIface_DoSomethingElse_Call struct { *mock.Call } // DoSomethingElse is a helper method to define mock.On call // - obj Sibling func (_e *MockUsesOtherPkgIface_Expecter) DoSomethingElse(obj interface{}) *MockUsesOtherPkgIface_DoSomethingElse_Call { return &MockUsesOtherPkgIface_DoSomethingElse_Call{Call: _e.mock.On("DoSomethingElse", obj)} } func (_c *MockUsesOtherPkgIface_DoSomethingElse_Call) Run(run func(obj Sibling)) *MockUsesOtherPkgIface_DoSomethingElse_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 Sibling if args[0] != nil { arg0 = args[0].(Sibling) } run( arg0, ) }) return _c } func (_c *MockUsesOtherPkgIface_DoSomethingElse_Call) Return() *MockUsesOtherPkgIface_DoSomethingElse_Call { _c.Call.Return() return _c } func (_c *MockUsesOtherPkgIface_DoSomethingElse_Call) RunAndReturn(run func(obj Sibling)) *MockUsesOtherPkgIface_DoSomethingElse_Call { _c.Run(run) return _c } // NewMockNilRun creates a new instance of MockNilRun. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockNilRun(t interface { mock.TestingT Cleanup(func()) }) *MockNilRun { mock := &MockNilRun{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockNilRun is an autogenerated mock type for the NilRun type type MockNilRun struct { mock.Mock } type MockNilRun_Expecter struct { mock *mock.Mock } func (_m *MockNilRun) EXPECT() *MockNilRun_Expecter { return &MockNilRun_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockNilRun func (_mock *MockNilRun) Foo(nilRun NilRun) { _mock.Called(nilRun) return } // MockNilRun_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockNilRun_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call // - nilRun NilRun func (_e *MockNilRun_Expecter) Foo(nilRun interface{}) *MockNilRun_Foo_Call { return &MockNilRun_Foo_Call{Call: _e.mock.On("Foo", nilRun)} } func (_c *MockNilRun_Foo_Call) Run(run func(nilRun NilRun)) *MockNilRun_Foo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 NilRun if args[0] != nil { arg0 = args[0].(NilRun) } run( arg0, ) }) return _c } func (_c *MockNilRun_Foo_Call) Return() *MockNilRun_Foo_Call { _c.Call.Return() return _c } func (_c *MockNilRun_Foo_Call) RunAndReturn(run func(nilRun NilRun)) *MockNilRun_Foo_Call { _c.Run(run) return _c } // NewMockPanicOnNoReturnValue creates a new instance of MockPanicOnNoReturnValue. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockPanicOnNoReturnValue(t interface { mock.TestingT Cleanup(func()) }) *MockPanicOnNoReturnValue { mock := &MockPanicOnNoReturnValue{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockPanicOnNoReturnValue is an autogenerated mock type for the PanicOnNoReturnValue type type MockPanicOnNoReturnValue struct { mock.Mock } type MockPanicOnNoReturnValue_Expecter struct { mock *mock.Mock } func (_m *MockPanicOnNoReturnValue) EXPECT() *MockPanicOnNoReturnValue_Expecter { return &MockPanicOnNoReturnValue_Expecter{mock: &_m.Mock} } // DoSomething provides a mock function for the type MockPanicOnNoReturnValue func (_mock *MockPanicOnNoReturnValue) DoSomething() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for DoSomething") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockPanicOnNoReturnValue_DoSomething_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoSomething' type MockPanicOnNoReturnValue_DoSomething_Call struct { *mock.Call } // DoSomething is a helper method to define mock.On call func (_e *MockPanicOnNoReturnValue_Expecter) DoSomething() *MockPanicOnNoReturnValue_DoSomething_Call { return &MockPanicOnNoReturnValue_DoSomething_Call{Call: _e.mock.On("DoSomething")} } func (_c *MockPanicOnNoReturnValue_DoSomething_Call) Run(run func()) *MockPanicOnNoReturnValue_DoSomething_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockPanicOnNoReturnValue_DoSomething_Call) Return(s string) *MockPanicOnNoReturnValue_DoSomething_Call { _c.Call.Return(s) return _c } func (_c *MockPanicOnNoReturnValue_DoSomething_Call) RunAndReturn(run func() string) *MockPanicOnNoReturnValue_DoSomething_Call { _c.Call.Return(run) return _c } // NewMockRequester creates a new instance of MockRequester. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequester(t interface { mock.TestingT Cleanup(func()) }) *MockRequester { mock := &MockRequester{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequester is an autogenerated mock type for the Requester type type MockRequester struct { mock.Mock } type MockRequester_Expecter struct { mock *mock.Mock } func (_m *MockRequester) EXPECT() *MockRequester_Expecter { return &MockRequester_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequester func (_mock *MockRequester) Get(path string) (string, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) string); ok { r0 = returnFunc(path) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockRequester_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequester_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequester_Expecter) Get(path interface{}) *MockRequester_Get_Call { return &MockRequester_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequester_Get_Call) Run(run func(path string)) *MockRequester_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequester_Get_Call) Return(s string, err error) *MockRequester_Get_Call { _c.Call.Return(s, err) return _c } func (_c *MockRequester_Get_Call) RunAndReturn(run func(path string) (string, error)) *MockRequester_Get_Call { _c.Call.Return(run) return _c } // NewMockRequester2 creates a new instance of MockRequester2. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequester2(t interface { mock.TestingT Cleanup(func()) }) *MockRequester2 { mock := &MockRequester2{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequester2 is an autogenerated mock type for the Requester2 type type MockRequester2 struct { mock.Mock } type MockRequester2_Expecter struct { mock *mock.Mock } func (_m *MockRequester2) EXPECT() *MockRequester2_Expecter { return &MockRequester2_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequester2 func (_mock *MockRequester2) Get(path string) error { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 error if returnFunc, ok := ret.Get(0).(func(string) error); ok { r0 = returnFunc(path) } else { r0 = ret.Error(0) } return r0 } // MockRequester2_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequester2_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequester2_Expecter) Get(path interface{}) *MockRequester2_Get_Call { return &MockRequester2_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequester2_Get_Call) Run(run func(path string)) *MockRequester2_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequester2_Get_Call) Return(err error) *MockRequester2_Get_Call { _c.Call.Return(err) return _c } func (_c *MockRequester2_Get_Call) RunAndReturn(run func(path string) error) *MockRequester2_Get_Call { _c.Call.Return(run) return _c } // NewMockRequester3 creates a new instance of MockRequester3. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequester3(t interface { mock.TestingT Cleanup(func()) }) *MockRequester3 { mock := &MockRequester3{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequester3 is an autogenerated mock type for the Requester3 type type MockRequester3 struct { mock.Mock } type MockRequester3_Expecter struct { mock *mock.Mock } func (_m *MockRequester3) EXPECT() *MockRequester3_Expecter { return &MockRequester3_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequester3 func (_mock *MockRequester3) Get() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // MockRequester3_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequester3_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockRequester3_Expecter) Get() *MockRequester3_Get_Call { return &MockRequester3_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockRequester3_Get_Call) Run(run func()) *MockRequester3_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockRequester3_Get_Call) Return(err error) *MockRequester3_Get_Call { _c.Call.Return(err) return _c } func (_c *MockRequester3_Get_Call) RunAndReturn(run func() error) *MockRequester3_Get_Call { _c.Call.Return(run) return _c } // NewMockRequester4 creates a new instance of MockRequester4. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequester4(t interface { mock.TestingT Cleanup(func()) }) *MockRequester4 { mock := &MockRequester4{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequester4 is an autogenerated mock type for the Requester4 type type MockRequester4 struct { mock.Mock } type MockRequester4_Expecter struct { mock *mock.Mock } func (_m *MockRequester4) EXPECT() *MockRequester4_Expecter { return &MockRequester4_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequester4 func (_mock *MockRequester4) Get() { _mock.Called() return } // MockRequester4_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequester4_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockRequester4_Expecter) Get() *MockRequester4_Get_Call { return &MockRequester4_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockRequester4_Get_Call) Run(run func()) *MockRequester4_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockRequester4_Get_Call) Return() *MockRequester4_Get_Call { _c.Call.Return() return _c } func (_c *MockRequester4_Get_Call) RunAndReturn(run func()) *MockRequester4_Get_Call { _c.Run(run) return _c } // NewMockRequesterArgSameAsImport creates a new instance of MockRequesterArgSameAsImport. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterArgSameAsImport(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterArgSameAsImport { mock := &MockRequesterArgSameAsImport{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterArgSameAsImport is an autogenerated mock type for the RequesterArgSameAsImport type type MockRequesterArgSameAsImport struct { mock.Mock } type MockRequesterArgSameAsImport_Expecter struct { mock *mock.Mock } func (_m *MockRequesterArgSameAsImport) EXPECT() *MockRequesterArgSameAsImport_Expecter { return &MockRequesterArgSameAsImport_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterArgSameAsImport func (_mock *MockRequesterArgSameAsImport) Get(json1 string) *json.RawMessage { ret := _mock.Called(json1) if len(ret) == 0 { panic("no return value specified for Get") } var r0 *json.RawMessage if returnFunc, ok := ret.Get(0).(func(string) *json.RawMessage); ok { r0 = returnFunc(json1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*json.RawMessage) } } return r0 } // MockRequesterArgSameAsImport_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterArgSameAsImport_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - json1 string func (_e *MockRequesterArgSameAsImport_Expecter) Get(json1 interface{}) *MockRequesterArgSameAsImport_Get_Call { return &MockRequesterArgSameAsImport_Get_Call{Call: _e.mock.On("Get", json1)} } func (_c *MockRequesterArgSameAsImport_Get_Call) Run(run func(json1 string)) *MockRequesterArgSameAsImport_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterArgSameAsImport_Get_Call) Return(rawMessage *json.RawMessage) *MockRequesterArgSameAsImport_Get_Call { _c.Call.Return(rawMessage) return _c } func (_c *MockRequesterArgSameAsImport_Get_Call) RunAndReturn(run func(json1 string) *json.RawMessage) *MockRequesterArgSameAsImport_Get_Call { _c.Call.Return(run) return _c } // NewMockRequesterArgSameAsNamedImport creates a new instance of MockRequesterArgSameAsNamedImport. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterArgSameAsNamedImport(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterArgSameAsNamedImport { mock := &MockRequesterArgSameAsNamedImport{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterArgSameAsNamedImport is an autogenerated mock type for the RequesterArgSameAsNamedImport type type MockRequesterArgSameAsNamedImport struct { mock.Mock } type MockRequesterArgSameAsNamedImport_Expecter struct { mock *mock.Mock } func (_m *MockRequesterArgSameAsNamedImport) EXPECT() *MockRequesterArgSameAsNamedImport_Expecter { return &MockRequesterArgSameAsNamedImport_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterArgSameAsNamedImport func (_mock *MockRequesterArgSameAsNamedImport) Get(json1 string) *json.RawMessage { ret := _mock.Called(json1) if len(ret) == 0 { panic("no return value specified for Get") } var r0 *json.RawMessage if returnFunc, ok := ret.Get(0).(func(string) *json.RawMessage); ok { r0 = returnFunc(json1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*json.RawMessage) } } return r0 } // MockRequesterArgSameAsNamedImport_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterArgSameAsNamedImport_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - json1 string func (_e *MockRequesterArgSameAsNamedImport_Expecter) Get(json1 interface{}) *MockRequesterArgSameAsNamedImport_Get_Call { return &MockRequesterArgSameAsNamedImport_Get_Call{Call: _e.mock.On("Get", json1)} } func (_c *MockRequesterArgSameAsNamedImport_Get_Call) Run(run func(json1 string)) *MockRequesterArgSameAsNamedImport_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterArgSameAsNamedImport_Get_Call) Return(rawMessage *json.RawMessage) *MockRequesterArgSameAsNamedImport_Get_Call { _c.Call.Return(rawMessage) return _c } func (_c *MockRequesterArgSameAsNamedImport_Get_Call) RunAndReturn(run func(json1 string) *json.RawMessage) *MockRequesterArgSameAsNamedImport_Get_Call { _c.Call.Return(run) return _c } // NewMockRequesterArgSameAsPkg creates a new instance of MockRequesterArgSameAsPkg. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterArgSameAsPkg(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterArgSameAsPkg { mock := &MockRequesterArgSameAsPkg{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterArgSameAsPkg is an autogenerated mock type for the RequesterArgSameAsPkg type type MockRequesterArgSameAsPkg struct { mock.Mock } type MockRequesterArgSameAsPkg_Expecter struct { mock *mock.Mock } func (_m *MockRequesterArgSameAsPkg) EXPECT() *MockRequesterArgSameAsPkg_Expecter { return &MockRequesterArgSameAsPkg_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterArgSameAsPkg func (_mock *MockRequesterArgSameAsPkg) Get(test1 string) { _mock.Called(test1) return } // MockRequesterArgSameAsPkg_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterArgSameAsPkg_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - test1 string func (_e *MockRequesterArgSameAsPkg_Expecter) Get(test1 interface{}) *MockRequesterArgSameAsPkg_Get_Call { return &MockRequesterArgSameAsPkg_Get_Call{Call: _e.mock.On("Get", test1)} } func (_c *MockRequesterArgSameAsPkg_Get_Call) Run(run func(test1 string)) *MockRequesterArgSameAsPkg_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterArgSameAsPkg_Get_Call) Return() *MockRequesterArgSameAsPkg_Get_Call { _c.Call.Return() return _c } func (_c *MockRequesterArgSameAsPkg_Get_Call) RunAndReturn(run func(test1 string)) *MockRequesterArgSameAsPkg_Get_Call { _c.Run(run) return _c } // NewMockRequesterArray creates a new instance of MockRequesterArray. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterArray(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterArray { mock := &MockRequesterArray{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterArray is an autogenerated mock type for the RequesterArray type type MockRequesterArray struct { mock.Mock } type MockRequesterArray_Expecter struct { mock *mock.Mock } func (_m *MockRequesterArray) EXPECT() *MockRequesterArray_Expecter { return &MockRequesterArray_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterArray func (_mock *MockRequesterArray) Get(path string) ([2]string, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 [2]string var r1 error if returnFunc, ok := ret.Get(0).(func(string) ([2]string, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) [2]string); ok { r0 = returnFunc(path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([2]string) } } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockRequesterArray_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterArray_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequesterArray_Expecter) Get(path interface{}) *MockRequesterArray_Get_Call { return &MockRequesterArray_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequesterArray_Get_Call) Run(run func(path string)) *MockRequesterArray_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterArray_Get_Call) Return(strings [2]string, err error) *MockRequesterArray_Get_Call { _c.Call.Return(strings, err) return _c } func (_c *MockRequesterArray_Get_Call) RunAndReturn(run func(path string) ([2]string, error)) *MockRequesterArray_Get_Call { _c.Call.Return(run) return _c } // NewMockRequesterElided creates a new instance of MockRequesterElided. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterElided(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterElided { mock := &MockRequesterElided{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterElided is an autogenerated mock type for the RequesterElided type type MockRequesterElided struct { mock.Mock } type MockRequesterElided_Expecter struct { mock *mock.Mock } func (_m *MockRequesterElided) EXPECT() *MockRequesterElided_Expecter { return &MockRequesterElided_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterElided func (_mock *MockRequesterElided) Get(path string, url string) error { ret := _mock.Called(path, url) if len(ret) == 0 { panic("no return value specified for Get") } var r0 error if returnFunc, ok := ret.Get(0).(func(string, string) error); ok { r0 = returnFunc(path, url) } else { r0 = ret.Error(0) } return r0 } // MockRequesterElided_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterElided_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string // - url string func (_e *MockRequesterElided_Expecter) Get(path interface{}, url interface{}) *MockRequesterElided_Get_Call { return &MockRequesterElided_Get_Call{Call: _e.mock.On("Get", path, url)} } func (_c *MockRequesterElided_Get_Call) Run(run func(path string, url string)) *MockRequesterElided_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *MockRequesterElided_Get_Call) Return(err error) *MockRequesterElided_Get_Call { _c.Call.Return(err) return _c } func (_c *MockRequesterElided_Get_Call) RunAndReturn(run func(path string, url string) error) *MockRequesterElided_Get_Call { _c.Call.Return(run) return _c } // NewMockRequesterIface creates a new instance of MockRequesterIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterIface(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterIface { mock := &MockRequesterIface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterIface is an autogenerated mock type for the RequesterIface type type MockRequesterIface struct { mock.Mock } type MockRequesterIface_Expecter struct { mock *mock.Mock } func (_m *MockRequesterIface) EXPECT() *MockRequesterIface_Expecter { return &MockRequesterIface_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterIface func (_mock *MockRequesterIface) Get() io.Reader { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 io.Reader if returnFunc, ok := ret.Get(0).(func() io.Reader); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(io.Reader) } } return r0 } // MockRequesterIface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterIface_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockRequesterIface_Expecter) Get() *MockRequesterIface_Get_Call { return &MockRequesterIface_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockRequesterIface_Get_Call) Run(run func()) *MockRequesterIface_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockRequesterIface_Get_Call) Return(reader io.Reader) *MockRequesterIface_Get_Call { _c.Call.Return(reader) return _c } func (_c *MockRequesterIface_Get_Call) RunAndReturn(run func() io.Reader) *MockRequesterIface_Get_Call { _c.Call.Return(run) return _c } // NewMockRequesterNS creates a new instance of MockRequesterNS. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterNS(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterNS { mock := &MockRequesterNS{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterNS is an autogenerated mock type for the RequesterNS type type MockRequesterNS struct { mock.Mock } type MockRequesterNS_Expecter struct { mock *mock.Mock } func (_m *MockRequesterNS) EXPECT() *MockRequesterNS_Expecter { return &MockRequesterNS_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterNS func (_mock *MockRequesterNS) Get(path string) (http.Response, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 http.Response var r1 error if returnFunc, ok := ret.Get(0).(func(string) (http.Response, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) http.Response); ok { r0 = returnFunc(path) } else { r0 = ret.Get(0).(http.Response) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockRequesterNS_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterNS_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequesterNS_Expecter) Get(path interface{}) *MockRequesterNS_Get_Call { return &MockRequesterNS_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequesterNS_Get_Call) Run(run func(path string)) *MockRequesterNS_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterNS_Get_Call) Return(response http.Response, err error) *MockRequesterNS_Get_Call { _c.Call.Return(response, err) return _c } func (_c *MockRequesterNS_Get_Call) RunAndReturn(run func(path string) (http.Response, error)) *MockRequesterNS_Get_Call { _c.Call.Return(run) return _c } // NewMockRequesterPtr creates a new instance of MockRequesterPtr. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterPtr(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterPtr { mock := &MockRequesterPtr{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterPtr is an autogenerated mock type for the RequesterPtr type type MockRequesterPtr struct { mock.Mock } type MockRequesterPtr_Expecter struct { mock *mock.Mock } func (_m *MockRequesterPtr) EXPECT() *MockRequesterPtr_Expecter { return &MockRequesterPtr_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterPtr func (_mock *MockRequesterPtr) Get(path string) (*string, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 *string var r1 error if returnFunc, ok := ret.Get(0).(func(string) (*string, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) *string); ok { r0 = returnFunc(path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*string) } } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockRequesterPtr_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterPtr_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequesterPtr_Expecter) Get(path interface{}) *MockRequesterPtr_Get_Call { return &MockRequesterPtr_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequesterPtr_Get_Call) Run(run func(path string)) *MockRequesterPtr_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterPtr_Get_Call) Return(s *string, err error) *MockRequesterPtr_Get_Call { _c.Call.Return(s, err) return _c } func (_c *MockRequesterPtr_Get_Call) RunAndReturn(run func(path string) (*string, error)) *MockRequesterPtr_Get_Call { _c.Call.Return(run) return _c } // NewMockRequesterReturnElided creates a new instance of MockRequesterReturnElided. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterReturnElided(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterReturnElided { mock := &MockRequesterReturnElided{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterReturnElided is an autogenerated mock type for the RequesterReturnElided type type MockRequesterReturnElided struct { mock.Mock } type MockRequesterReturnElided_Expecter struct { mock *mock.Mock } func (_m *MockRequesterReturnElided) EXPECT() *MockRequesterReturnElided_Expecter { return &MockRequesterReturnElided_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterReturnElided func (_mock *MockRequesterReturnElided) Get(path string) (int, int, int, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 int var r1 int var r2 int var r3 error if returnFunc, ok := ret.Get(0).(func(string) (int, int, int, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) int); ok { r0 = returnFunc(path) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func(string) int); ok { r1 = returnFunc(path) } else { r1 = ret.Get(1).(int) } if returnFunc, ok := ret.Get(2).(func(string) int); ok { r2 = returnFunc(path) } else { r2 = ret.Get(2).(int) } if returnFunc, ok := ret.Get(3).(func(string) error); ok { r3 = returnFunc(path) } else { r3 = ret.Error(3) } return r0, r1, r2, r3 } // MockRequesterReturnElided_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterReturnElided_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequesterReturnElided_Expecter) Get(path interface{}) *MockRequesterReturnElided_Get_Call { return &MockRequesterReturnElided_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequesterReturnElided_Get_Call) Run(run func(path string)) *MockRequesterReturnElided_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterReturnElided_Get_Call) Return(a int, b int, c int, err error) *MockRequesterReturnElided_Get_Call { _c.Call.Return(a, b, c, err) return _c } func (_c *MockRequesterReturnElided_Get_Call) RunAndReturn(run func(path string) (int, int, int, error)) *MockRequesterReturnElided_Get_Call { _c.Call.Return(run) return _c } // Put provides a mock function for the type MockRequesterReturnElided func (_mock *MockRequesterReturnElided) Put(path string) (int, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Put") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func(string) (int, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) int); ok { r0 = returnFunc(path) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockRequesterReturnElided_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' type MockRequesterReturnElided_Put_Call struct { *mock.Call } // Put is a helper method to define mock.On call // - path string func (_e *MockRequesterReturnElided_Expecter) Put(path interface{}) *MockRequesterReturnElided_Put_Call { return &MockRequesterReturnElided_Put_Call{Call: _e.mock.On("Put", path)} } func (_c *MockRequesterReturnElided_Put_Call) Run(run func(path string)) *MockRequesterReturnElided_Put_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterReturnElided_Put_Call) Return(n int, err error) *MockRequesterReturnElided_Put_Call { _c.Call.Return(n, err) return _c } func (_c *MockRequesterReturnElided_Put_Call) RunAndReturn(run func(path string) (int, error)) *MockRequesterReturnElided_Put_Call { _c.Call.Return(run) return _c } // NewMockRequesterSlice creates a new instance of MockRequesterSlice. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterSlice(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterSlice { mock := &MockRequesterSlice{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterSlice is an autogenerated mock type for the RequesterSlice type type MockRequesterSlice struct { mock.Mock } type MockRequesterSlice_Expecter struct { mock *mock.Mock } func (_m *MockRequesterSlice) EXPECT() *MockRequesterSlice_Expecter { return &MockRequesterSlice_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterSlice func (_mock *MockRequesterSlice) Get(path string) ([]string, error) { ret := _mock.Called(path) if len(ret) == 0 { panic("no return value specified for Get") } var r0 []string var r1 error if returnFunc, ok := ret.Get(0).(func(string) ([]string, error)); ok { return returnFunc(path) } if returnFunc, ok := ret.Get(0).(func(string) []string); ok { r0 = returnFunc(path) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]string) } } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(path) } else { r1 = ret.Error(1) } return r0, r1 } // MockRequesterSlice_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterSlice_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - path string func (_e *MockRequesterSlice_Expecter) Get(path interface{}) *MockRequesterSlice_Get_Call { return &MockRequesterSlice_Get_Call{Call: _e.mock.On("Get", path)} } func (_c *MockRequesterSlice_Get_Call) Run(run func(path string)) *MockRequesterSlice_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockRequesterSlice_Get_Call) Return(strings []string, err error) *MockRequesterSlice_Get_Call { _c.Call.Return(strings, err) return _c } func (_c *MockRequesterSlice_Get_Call) RunAndReturn(run func(path string) ([]string, error)) *MockRequesterSlice_Get_Call { _c.Call.Return(run) return _c } // newMockrequesterUnexported creates a new instance of mockrequesterUnexported. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockrequesterUnexported(t interface { mock.TestingT Cleanup(func()) }) *mockrequesterUnexported { mock := &mockrequesterUnexported{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // mockrequesterUnexported is an autogenerated mock type for the requesterUnexported type type mockrequesterUnexported struct { mock.Mock } type mockrequesterUnexported_Expecter struct { mock *mock.Mock } func (_m *mockrequesterUnexported) EXPECT() *mockrequesterUnexported_Expecter { return &mockrequesterUnexported_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type mockrequesterUnexported func (_mock *mockrequesterUnexported) Get() { _mock.Called() return } // mockrequesterUnexported_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type mockrequesterUnexported_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *mockrequesterUnexported_Expecter) Get() *mockrequesterUnexported_Get_Call { return &mockrequesterUnexported_Get_Call{Call: _e.mock.On("Get")} } func (_c *mockrequesterUnexported_Get_Call) Run(run func()) *mockrequesterUnexported_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *mockrequesterUnexported_Get_Call) Return() *mockrequesterUnexported_Get_Call { _c.Call.Return() return _c } func (_c *mockrequesterUnexported_Get_Call) RunAndReturn(run func()) *mockrequesterUnexported_Get_Call { _c.Run(run) return _c } // NewMockRequesterVariadicOneArgument creates a new instance of MockRequesterVariadicOneArgument. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterVariadicOneArgument(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterVariadicOneArgument { mock := &MockRequesterVariadicOneArgument{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterVariadicOneArgument is an autogenerated mock type for the RequesterVariadic type type MockRequesterVariadicOneArgument struct { mock.Mock } type MockRequesterVariadicOneArgument_Expecter struct { mock *mock.Mock } func (_m *MockRequesterVariadicOneArgument) EXPECT() *MockRequesterVariadicOneArgument_Expecter { return &MockRequesterVariadicOneArgument_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterVariadicOneArgument func (_mock *MockRequesterVariadicOneArgument) Get(values ...string) bool { var tmpRet mock.Arguments if len(values) > 0 { tmpRet = _mock.Called(values) } else { tmpRet = _mock.Called() } ret := tmpRet if len(ret) == 0 { panic("no return value specified for Get") } var r0 bool if returnFunc, ok := ret.Get(0).(func(...string) bool); ok { r0 = returnFunc(values...) } else { r0 = ret.Get(0).(bool) } return r0 } // MockRequesterVariadicOneArgument_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterVariadicOneArgument_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - values ...string func (_e *MockRequesterVariadicOneArgument_Expecter) Get(values ...interface{}) *MockRequesterVariadicOneArgument_Get_Call { return &MockRequesterVariadicOneArgument_Get_Call{Call: _e.mock.On("Get", append([]interface{}{}, values...)...)} } func (_c *MockRequesterVariadicOneArgument_Get_Call) Run(run func(values ...string)) *MockRequesterVariadicOneArgument_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []string var variadicArgs []string if len(args) > 0 { variadicArgs = args[0].([]string) } arg0 = variadicArgs run( arg0..., ) }) return _c } func (_c *MockRequesterVariadicOneArgument_Get_Call) Return(b bool) *MockRequesterVariadicOneArgument_Get_Call { _c.Call.Return(b) return _c } func (_c *MockRequesterVariadicOneArgument_Get_Call) RunAndReturn(run func(values ...string) bool) *MockRequesterVariadicOneArgument_Get_Call { _c.Call.Return(run) return _c } // MultiWriteToFile provides a mock function for the type MockRequesterVariadicOneArgument func (_mock *MockRequesterVariadicOneArgument) MultiWriteToFile(filename string, w ...io.Writer) string { var tmpRet mock.Arguments if len(w) > 0 { tmpRet = _mock.Called(filename, w) } else { tmpRet = _mock.Called(filename) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for MultiWriteToFile") } var r0 string if returnFunc, ok := ret.Get(0).(func(string, ...io.Writer) string); ok { r0 = returnFunc(filename, w...) } else { r0 = ret.Get(0).(string) } return r0 } // MockRequesterVariadicOneArgument_MultiWriteToFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiWriteToFile' type MockRequesterVariadicOneArgument_MultiWriteToFile_Call struct { *mock.Call } // MultiWriteToFile is a helper method to define mock.On call // - filename string // - w ...io.Writer func (_e *MockRequesterVariadicOneArgument_Expecter) MultiWriteToFile(filename interface{}, w ...interface{}) *MockRequesterVariadicOneArgument_MultiWriteToFile_Call { return &MockRequesterVariadicOneArgument_MultiWriteToFile_Call{Call: _e.mock.On("MultiWriteToFile", append([]interface{}{filename}, w...)...)} } func (_c *MockRequesterVariadicOneArgument_MultiWriteToFile_Call) Run(run func(filename string, w ...io.Writer)) *MockRequesterVariadicOneArgument_MultiWriteToFile_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []io.Writer var variadicArgs []io.Writer if len(args) > 1 { variadicArgs = args[1].([]io.Writer) } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockRequesterVariadicOneArgument_MultiWriteToFile_Call) Return(s string) *MockRequesterVariadicOneArgument_MultiWriteToFile_Call { _c.Call.Return(s) return _c } func (_c *MockRequesterVariadicOneArgument_MultiWriteToFile_Call) RunAndReturn(run func(filename string, w ...io.Writer) string) *MockRequesterVariadicOneArgument_MultiWriteToFile_Call { _c.Call.Return(run) return _c } // OneInterface provides a mock function for the type MockRequesterVariadicOneArgument func (_mock *MockRequesterVariadicOneArgument) OneInterface(a ...interface{}) bool { var tmpRet mock.Arguments if len(a) > 0 { tmpRet = _mock.Called(a) } else { tmpRet = _mock.Called() } ret := tmpRet if len(ret) == 0 { panic("no return value specified for OneInterface") } var r0 bool if returnFunc, ok := ret.Get(0).(func(...interface{}) bool); ok { r0 = returnFunc(a...) } else { r0 = ret.Get(0).(bool) } return r0 } // MockRequesterVariadicOneArgument_OneInterface_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OneInterface' type MockRequesterVariadicOneArgument_OneInterface_Call struct { *mock.Call } // OneInterface is a helper method to define mock.On call // - a ...interface{} func (_e *MockRequesterVariadicOneArgument_Expecter) OneInterface(a ...interface{}) *MockRequesterVariadicOneArgument_OneInterface_Call { return &MockRequesterVariadicOneArgument_OneInterface_Call{Call: _e.mock.On("OneInterface", append([]interface{}{}, a...)...)} } func (_c *MockRequesterVariadicOneArgument_OneInterface_Call) Run(run func(a ...interface{})) *MockRequesterVariadicOneArgument_OneInterface_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []interface{} var variadicArgs []interface{} if len(args) > 0 { variadicArgs = args[0].([]interface{}) } arg0 = variadicArgs run( arg0..., ) }) return _c } func (_c *MockRequesterVariadicOneArgument_OneInterface_Call) Return(b bool) *MockRequesterVariadicOneArgument_OneInterface_Call { _c.Call.Return(b) return _c } func (_c *MockRequesterVariadicOneArgument_OneInterface_Call) RunAndReturn(run func(a ...interface{}) bool) *MockRequesterVariadicOneArgument_OneInterface_Call { _c.Call.Return(run) return _c } // Sprintf provides a mock function for the type MockRequesterVariadicOneArgument func (_mock *MockRequesterVariadicOneArgument) Sprintf(format string, a ...interface{}) string { var tmpRet mock.Arguments if len(a) > 0 { tmpRet = _mock.Called(format, a) } else { tmpRet = _mock.Called(format) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for Sprintf") } var r0 string if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) string); ok { r0 = returnFunc(format, a...) } else { r0 = ret.Get(0).(string) } return r0 } // MockRequesterVariadicOneArgument_Sprintf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sprintf' type MockRequesterVariadicOneArgument_Sprintf_Call struct { *mock.Call } // Sprintf is a helper method to define mock.On call // - format string // - a ...interface{} func (_e *MockRequesterVariadicOneArgument_Expecter) Sprintf(format interface{}, a ...interface{}) *MockRequesterVariadicOneArgument_Sprintf_Call { return &MockRequesterVariadicOneArgument_Sprintf_Call{Call: _e.mock.On("Sprintf", append([]interface{}{format}, a...)...)} } func (_c *MockRequesterVariadicOneArgument_Sprintf_Call) Run(run func(format string, a ...interface{})) *MockRequesterVariadicOneArgument_Sprintf_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []interface{} var variadicArgs []interface{} if len(args) > 1 { variadicArgs = args[1].([]interface{}) } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockRequesterVariadicOneArgument_Sprintf_Call) Return(s string) *MockRequesterVariadicOneArgument_Sprintf_Call { _c.Call.Return(s) return _c } func (_c *MockRequesterVariadicOneArgument_Sprintf_Call) RunAndReturn(run func(format string, a ...interface{}) string) *MockRequesterVariadicOneArgument_Sprintf_Call { _c.Call.Return(run) return _c } // NewMockRequesterVariadic creates a new instance of MockRequesterVariadic. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockRequesterVariadic(t interface { mock.TestingT Cleanup(func()) }) *MockRequesterVariadic { mock := &MockRequesterVariadic{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockRequesterVariadic is an autogenerated mock type for the RequesterVariadic type type MockRequesterVariadic struct { mock.Mock } type MockRequesterVariadic_Expecter struct { mock *mock.Mock } func (_m *MockRequesterVariadic) EXPECT() *MockRequesterVariadic_Expecter { return &MockRequesterVariadic_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockRequesterVariadic func (_mock *MockRequesterVariadic) Get(values ...string) bool { // string _va := make([]interface{}, len(values)) for _i := range values { _va[_i] = values[_i] } var _ca []interface{} _ca = append(_ca, _va...) ret := _mock.Called(_ca...) if len(ret) == 0 { panic("no return value specified for Get") } var r0 bool if returnFunc, ok := ret.Get(0).(func(...string) bool); ok { r0 = returnFunc(values...) } else { r0 = ret.Get(0).(bool) } return r0 } // MockRequesterVariadic_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockRequesterVariadic_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - values ...string func (_e *MockRequesterVariadic_Expecter) Get(values ...interface{}) *MockRequesterVariadic_Get_Call { return &MockRequesterVariadic_Get_Call{Call: _e.mock.On("Get", append([]interface{}{}, values...)...)} } func (_c *MockRequesterVariadic_Get_Call) Run(run func(values ...string)) *MockRequesterVariadic_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []string variadicArgs := make([]string, len(args)-0) for i, a := range args[0:] { if a != nil { variadicArgs[i] = a.(string) } } arg0 = variadicArgs run( arg0..., ) }) return _c } func (_c *MockRequesterVariadic_Get_Call) Return(b bool) *MockRequesterVariadic_Get_Call { _c.Call.Return(b) return _c } func (_c *MockRequesterVariadic_Get_Call) RunAndReturn(run func(values ...string) bool) *MockRequesterVariadic_Get_Call { _c.Call.Return(run) return _c } // MultiWriteToFile provides a mock function for the type MockRequesterVariadic func (_mock *MockRequesterVariadic) MultiWriteToFile(filename string, w ...io.Writer) string { // io.Writer _va := make([]interface{}, len(w)) for _i := range w { _va[_i] = w[_i] } var _ca []interface{} _ca = append(_ca, filename) _ca = append(_ca, _va...) ret := _mock.Called(_ca...) if len(ret) == 0 { panic("no return value specified for MultiWriteToFile") } var r0 string if returnFunc, ok := ret.Get(0).(func(string, ...io.Writer) string); ok { r0 = returnFunc(filename, w...) } else { r0 = ret.Get(0).(string) } return r0 } // MockRequesterVariadic_MultiWriteToFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiWriteToFile' type MockRequesterVariadic_MultiWriteToFile_Call struct { *mock.Call } // MultiWriteToFile is a helper method to define mock.On call // - filename string // - w ...io.Writer func (_e *MockRequesterVariadic_Expecter) MultiWriteToFile(filename interface{}, w ...interface{}) *MockRequesterVariadic_MultiWriteToFile_Call { return &MockRequesterVariadic_MultiWriteToFile_Call{Call: _e.mock.On("MultiWriteToFile", append([]interface{}{filename}, w...)...)} } func (_c *MockRequesterVariadic_MultiWriteToFile_Call) Run(run func(filename string, w ...io.Writer)) *MockRequesterVariadic_MultiWriteToFile_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []io.Writer variadicArgs := make([]io.Writer, len(args)-1) for i, a := range args[1:] { if a != nil { variadicArgs[i] = a.(io.Writer) } } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockRequesterVariadic_MultiWriteToFile_Call) Return(s string) *MockRequesterVariadic_MultiWriteToFile_Call { _c.Call.Return(s) return _c } func (_c *MockRequesterVariadic_MultiWriteToFile_Call) RunAndReturn(run func(filename string, w ...io.Writer) string) *MockRequesterVariadic_MultiWriteToFile_Call { _c.Call.Return(run) return _c } // OneInterface provides a mock function for the type MockRequesterVariadic func (_mock *MockRequesterVariadic) OneInterface(a ...interface{}) bool { var _ca []interface{} _ca = append(_ca, a...) ret := _mock.Called(_ca...) if len(ret) == 0 { panic("no return value specified for OneInterface") } var r0 bool if returnFunc, ok := ret.Get(0).(func(...interface{}) bool); ok { r0 = returnFunc(a...) } else { r0 = ret.Get(0).(bool) } return r0 } // MockRequesterVariadic_OneInterface_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OneInterface' type MockRequesterVariadic_OneInterface_Call struct { *mock.Call } // OneInterface is a helper method to define mock.On call // - a ...interface{} func (_e *MockRequesterVariadic_Expecter) OneInterface(a ...interface{}) *MockRequesterVariadic_OneInterface_Call { return &MockRequesterVariadic_OneInterface_Call{Call: _e.mock.On("OneInterface", append([]interface{}{}, a...)...)} } func (_c *MockRequesterVariadic_OneInterface_Call) Run(run func(a ...interface{})) *MockRequesterVariadic_OneInterface_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 []interface{} variadicArgs := make([]interface{}, len(args)-0) for i, a := range args[0:] { if a != nil { variadicArgs[i] = a.(interface{}) } } arg0 = variadicArgs run( arg0..., ) }) return _c } func (_c *MockRequesterVariadic_OneInterface_Call) Return(b bool) *MockRequesterVariadic_OneInterface_Call { _c.Call.Return(b) return _c } func (_c *MockRequesterVariadic_OneInterface_Call) RunAndReturn(run func(a ...interface{}) bool) *MockRequesterVariadic_OneInterface_Call { _c.Call.Return(run) return _c } // Sprintf provides a mock function for the type MockRequesterVariadic func (_mock *MockRequesterVariadic) Sprintf(format string, a ...interface{}) string { var _ca []interface{} _ca = append(_ca, format) _ca = append(_ca, a...) ret := _mock.Called(_ca...) if len(ret) == 0 { panic("no return value specified for Sprintf") } var r0 string if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) string); ok { r0 = returnFunc(format, a...) } else { r0 = ret.Get(0).(string) } return r0 } // MockRequesterVariadic_Sprintf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sprintf' type MockRequesterVariadic_Sprintf_Call struct { *mock.Call } // Sprintf is a helper method to define mock.On call // - format string // - a ...interface{} func (_e *MockRequesterVariadic_Expecter) Sprintf(format interface{}, a ...interface{}) *MockRequesterVariadic_Sprintf_Call { return &MockRequesterVariadic_Sprintf_Call{Call: _e.mock.On("Sprintf", append([]interface{}{format}, a...)...)} } func (_c *MockRequesterVariadic_Sprintf_Call) Run(run func(format string, a ...interface{})) *MockRequesterVariadic_Sprintf_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []interface{} variadicArgs := make([]interface{}, len(args)-1) for i, a := range args[1:] { if a != nil { variadicArgs[i] = a.(interface{}) } } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockRequesterVariadic_Sprintf_Call) Return(s string) *MockRequesterVariadic_Sprintf_Call { _c.Call.Return(s) return _c } func (_c *MockRequesterVariadic_Sprintf_Call) RunAndReturn(run func(format string, a ...interface{}) string) *MockRequesterVariadic_Sprintf_Call { _c.Call.Return(run) return _c } // NewMockExample creates a new instance of MockExample. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockExample(t interface { mock.TestingT Cleanup(func()) }) *MockExample { mock := &MockExample{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockExample is an autogenerated mock type for the Example type type MockExample struct { mock.Mock } type MockExample_Expecter struct { mock *mock.Mock } func (_m *MockExample) EXPECT() *MockExample_Expecter { return &MockExample_Expecter{mock: &_m.Mock} } // A provides a mock function for the type MockExample func (_mock *MockExample) A() http.Flusher { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for A") } var r0 http.Flusher if returnFunc, ok := ret.Get(0).(func() http.Flusher); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(http.Flusher) } } return r0 } // MockExample_A_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'A' type MockExample_A_Call struct { *mock.Call } // A is a helper method to define mock.On call func (_e *MockExample_Expecter) A() *MockExample_A_Call { return &MockExample_A_Call{Call: _e.mock.On("A")} } func (_c *MockExample_A_Call) Run(run func()) *MockExample_A_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockExample_A_Call) Return(flusher http.Flusher) *MockExample_A_Call { _c.Call.Return(flusher) return _c } func (_c *MockExample_A_Call) RunAndReturn(run func() http.Flusher) *MockExample_A_Call { _c.Call.Return(run) return _c } // B provides a mock function for the type MockExample func (_mock *MockExample) B(fixtureshttp string) http0.MyStruct { ret := _mock.Called(fixtureshttp) if len(ret) == 0 { panic("no return value specified for B") } var r0 http0.MyStruct if returnFunc, ok := ret.Get(0).(func(string) http0.MyStruct); ok { r0 = returnFunc(fixtureshttp) } else { r0 = ret.Get(0).(http0.MyStruct) } return r0 } // MockExample_B_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'B' type MockExample_B_Call struct { *mock.Call } // B is a helper method to define mock.On call // - fixtureshttp string func (_e *MockExample_Expecter) B(fixtureshttp interface{}) *MockExample_B_Call { return &MockExample_B_Call{Call: _e.mock.On("B", fixtureshttp)} } func (_c *MockExample_B_Call) Run(run func(fixtureshttp string)) *MockExample_B_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockExample_B_Call) Return(myStruct http0.MyStruct) *MockExample_B_Call { _c.Call.Return(myStruct) return _c } func (_c *MockExample_B_Call) RunAndReturn(run func(fixtureshttp string) http0.MyStruct) *MockExample_B_Call { _c.Call.Return(run) return _c } // C provides a mock function for the type MockExample func (_mock *MockExample) C(fixtureshttp string) http1.MyStruct { ret := _mock.Called(fixtureshttp) if len(ret) == 0 { panic("no return value specified for C") } var r0 http1.MyStruct if returnFunc, ok := ret.Get(0).(func(string) http1.MyStruct); ok { r0 = returnFunc(fixtureshttp) } else { r0 = ret.Get(0).(http1.MyStruct) } return r0 } // MockExample_C_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'C' type MockExample_C_Call struct { *mock.Call } // C is a helper method to define mock.On call // - fixtureshttp string func (_e *MockExample_Expecter) C(fixtureshttp interface{}) *MockExample_C_Call { return &MockExample_C_Call{Call: _e.mock.On("C", fixtureshttp)} } func (_c *MockExample_C_Call) Run(run func(fixtureshttp string)) *MockExample_C_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockExample_C_Call) Return(myStruct http1.MyStruct) *MockExample_C_Call { _c.Call.Return(myStruct) return _c } func (_c *MockExample_C_Call) RunAndReturn(run func(fixtureshttp string) http1.MyStruct) *MockExample_C_Call { _c.Call.Return(run) return _c } // NewMockA creates a new instance of MockA. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockA(t interface { mock.TestingT Cleanup(func()) }) *MockA { mock := &MockA{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockA is an autogenerated mock type for the A type type MockA struct { mock.Mock } type MockA_Expecter struct { mock *mock.Mock } func (_m *MockA) EXPECT() *MockA_Expecter { return &MockA_Expecter{mock: &_m.Mock} } // Call provides a mock function for the type MockA func (_mock *MockA) Call() (B, error) { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Call") } var r0 B var r1 error if returnFunc, ok := ret.Get(0).(func() (B, error)); ok { return returnFunc() } if returnFunc, ok := ret.Get(0).(func() B); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(B) } if returnFunc, ok := ret.Get(1).(func() error); ok { r1 = returnFunc() } else { r1 = ret.Error(1) } return r0, r1 } // MockA_Call_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Call' type MockA_Call_Call struct { *mock.Call } // Call is a helper method to define mock.On call func (_e *MockA_Expecter) Call() *MockA_Call_Call { return &MockA_Call_Call{Call: _e.mock.On("Call")} } func (_c *MockA_Call_Call) Run(run func()) *MockA_Call_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockA_Call_Call) Return(b B, err error) *MockA_Call_Call { _c.Call.Return(b, err) return _c } func (_c *MockA_Call_Call) RunAndReturn(run func() (B, error)) *MockA_Call_Call { _c.Call.Return(run) return _c } // NewMockStructWithTag creates a new instance of MockStructWithTag. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockStructWithTag(t interface { mock.TestingT Cleanup(func()) }) *MockStructWithTag { mock := &MockStructWithTag{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockStructWithTag is an autogenerated mock type for the StructWithTag type type MockStructWithTag struct { mock.Mock } type MockStructWithTag_Expecter struct { mock *mock.Mock } func (_m *MockStructWithTag) EXPECT() *MockStructWithTag_Expecter { return &MockStructWithTag_Expecter{mock: &_m.Mock} } // MethodA provides a mock function for the type MockStructWithTag func (_mock *MockStructWithTag) MethodA(v *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" }) *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" } { ret := _mock.Called(v) if len(ret) == 0 { panic("no return value specified for MethodA") } var r0 *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" } if returnFunc, ok := ret.Get(0).(func(*struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" }) *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" }); ok { r0 = returnFunc(v) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" }) } } return r0 } // MockStructWithTag_MethodA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MethodA' type MockStructWithTag_MethodA_Call struct { *mock.Call } // MethodA is a helper method to define mock.On call // - v *struct{FieldA int "json:\"field_a\""; FieldB int "json:\"field_b\" xml:\"field_b\""} func (_e *MockStructWithTag_Expecter) MethodA(v interface{}) *MockStructWithTag_MethodA_Call { return &MockStructWithTag_MethodA_Call{Call: _e.mock.On("MethodA", v)} } func (_c *MockStructWithTag_MethodA_Call) Run(run func(v *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" })) *MockStructWithTag_MethodA_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" } if args[0] != nil { arg0 = args[0].(*struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" }) } run( arg0, ) }) return _c } func (_c *MockStructWithTag_MethodA_Call) Return(val *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" }) *MockStructWithTag_MethodA_Call { _c.Call.Return(val) return _c } func (_c *MockStructWithTag_MethodA_Call) RunAndReturn(run func(v *struct { FieldA int "json:\"field_a\"" FieldB int "json:\"field_b\" xml:\"field_b\"" }) *struct { FieldC int "json:\"field_c\"" FieldD int "json:\"field_d\" xml:\"field_d\"" }) *MockStructWithTag_MethodA_Call { _c.Call.Return(run) return _c } // NewMockUnsafeInterface creates a new instance of MockUnsafeInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockUnsafeInterface(t interface { mock.TestingT Cleanup(func()) }) *MockUnsafeInterface { mock := &MockUnsafeInterface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockUnsafeInterface is an autogenerated mock type for the UnsafeInterface type type MockUnsafeInterface struct { mock.Mock } type MockUnsafeInterface_Expecter struct { mock *mock.Mock } func (_m *MockUnsafeInterface) EXPECT() *MockUnsafeInterface_Expecter { return &MockUnsafeInterface_Expecter{mock: &_m.Mock} } // Do provides a mock function for the type MockUnsafeInterface func (_mock *MockUnsafeInterface) Do(ptr *unsafe.Pointer) { _mock.Called(ptr) return } // MockUnsafeInterface_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do' type MockUnsafeInterface_Do_Call struct { *mock.Call } // Do is a helper method to define mock.On call // - ptr *unsafe.Pointer func (_e *MockUnsafeInterface_Expecter) Do(ptr interface{}) *MockUnsafeInterface_Do_Call { return &MockUnsafeInterface_Do_Call{Call: _e.mock.On("Do", ptr)} } func (_c *MockUnsafeInterface_Do_Call) Run(run func(ptr *unsafe.Pointer)) *MockUnsafeInterface_Do_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 *unsafe.Pointer if args[0] != nil { arg0 = args[0].(*unsafe.Pointer) } run( arg0, ) }) return _c } func (_c *MockUnsafeInterface_Do_Call) Return() *MockUnsafeInterface_Do_Call { _c.Call.Return() return _c } func (_c *MockUnsafeInterface_Do_Call) RunAndReturn(run func(ptr *unsafe.Pointer)) *MockUnsafeInterface_Do_Call { _c.Run(run) return _c } // NewMockVariadic creates a new instance of MockVariadic. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockVariadic(t interface { mock.TestingT Cleanup(func()) }) *MockVariadic { mock := &MockVariadic{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockVariadic is an autogenerated mock type for the Variadic type type MockVariadic struct { mock.Mock } type MockVariadic_Expecter struct { mock *mock.Mock } func (_m *MockVariadic) EXPECT() *MockVariadic_Expecter { return &MockVariadic_Expecter{mock: &_m.Mock} } // VariadicFunction provides a mock function for the type MockVariadic func (_mock *MockVariadic) VariadicFunction(str string, vFunc VariadicFunction) error { ret := _mock.Called(str, vFunc) if len(ret) == 0 { panic("no return value specified for VariadicFunction") } var r0 error if returnFunc, ok := ret.Get(0).(func(string, VariadicFunction) error); ok { r0 = returnFunc(str, vFunc) } else { r0 = ret.Error(0) } return r0 } // MockVariadic_VariadicFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VariadicFunction' type MockVariadic_VariadicFunction_Call struct { *mock.Call } // VariadicFunction is a helper method to define mock.On call // - str string // - vFunc VariadicFunction func (_e *MockVariadic_Expecter) VariadicFunction(str interface{}, vFunc interface{}) *MockVariadic_VariadicFunction_Call { return &MockVariadic_VariadicFunction_Call{Call: _e.mock.On("VariadicFunction", str, vFunc)} } func (_c *MockVariadic_VariadicFunction_Call) Run(run func(str string, vFunc VariadicFunction)) *MockVariadic_VariadicFunction_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 VariadicFunction if args[1] != nil { arg1 = args[1].(VariadicFunction) } run( arg0, arg1, ) }) return _c } func (_c *MockVariadic_VariadicFunction_Call) Return(err error) *MockVariadic_VariadicFunction_Call { _c.Call.Return(err) return _c } func (_c *MockVariadic_VariadicFunction_Call) RunAndReturn(run func(str string, vFunc VariadicFunction) error) *MockVariadic_VariadicFunction_Call { _c.Call.Return(run) return _c } // NewMockVariadicReturnFunc creates a new instance of MockVariadicReturnFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockVariadicReturnFunc(t interface { mock.TestingT Cleanup(func()) }) *MockVariadicReturnFunc { mock := &MockVariadicReturnFunc{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockVariadicReturnFunc is an autogenerated mock type for the VariadicReturnFunc type type MockVariadicReturnFunc struct { mock.Mock } type MockVariadicReturnFunc_Expecter struct { mock *mock.Mock } func (_m *MockVariadicReturnFunc) EXPECT() *MockVariadicReturnFunc_Expecter { return &MockVariadicReturnFunc_Expecter{mock: &_m.Mock} } // SampleMethod provides a mock function for the type MockVariadicReturnFunc func (_mock *MockVariadicReturnFunc) SampleMethod(str string) func(str string, arr []int, a ...interface{}) { ret := _mock.Called(str) if len(ret) == 0 { panic("no return value specified for SampleMethod") } var r0 func(str string, arr []int, a ...interface{}) if returnFunc, ok := ret.Get(0).(func(string) func(str string, arr []int, a ...interface{})); ok { r0 = returnFunc(str) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(func(str string, arr []int, a ...interface{})) } } return r0 } // MockVariadicReturnFunc_SampleMethod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SampleMethod' type MockVariadicReturnFunc_SampleMethod_Call struct { *mock.Call } // SampleMethod is a helper method to define mock.On call // - str string func (_e *MockVariadicReturnFunc_Expecter) SampleMethod(str interface{}) *MockVariadicReturnFunc_SampleMethod_Call { return &MockVariadicReturnFunc_SampleMethod_Call{Call: _e.mock.On("SampleMethod", str)} } func (_c *MockVariadicReturnFunc_SampleMethod_Call) Run(run func(str string)) *MockVariadicReturnFunc_SampleMethod_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *MockVariadicReturnFunc_SampleMethod_Call) Return(fn func(str string, arr []int, a ...interface{})) *MockVariadicReturnFunc_SampleMethod_Call { _c.Call.Return(fn) return _c } func (_c *MockVariadicReturnFunc_SampleMethod_Call) RunAndReturn(run func(str string) func(str string, arr []int, a ...interface{})) *MockVariadicReturnFunc_SampleMethod_Call { _c.Call.Return(run) return _c } // NewMockVariadicWithMultipleReturnsUnrollVariadic creates a new instance of MockVariadicWithMultipleReturnsUnrollVariadic. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockVariadicWithMultipleReturnsUnrollVariadic(t interface { mock.TestingT Cleanup(func()) }) *MockVariadicWithMultipleReturnsUnrollVariadic { mock := &MockVariadicWithMultipleReturnsUnrollVariadic{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockVariadicWithMultipleReturnsUnrollVariadic is an autogenerated mock type for the VariadicWithMultipleReturns type type MockVariadicWithMultipleReturnsUnrollVariadic struct { mock.Mock } type MockVariadicWithMultipleReturnsUnrollVariadic_Expecter struct { mock *mock.Mock } func (_m *MockVariadicWithMultipleReturnsUnrollVariadic) EXPECT() *MockVariadicWithMultipleReturnsUnrollVariadic_Expecter { return &MockVariadicWithMultipleReturnsUnrollVariadic_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockVariadicWithMultipleReturnsUnrollVariadic func (_mock *MockVariadicWithMultipleReturnsUnrollVariadic) Foo(one string, two ...string) (string, error) { // string _va := make([]interface{}, len(two)) for _i := range two { _va[_i] = two[_i] } var _ca []interface{} _ca = append(_ca, one) _ca = append(_ca, _va...) ret := _mock.Called(_ca...) if len(ret) == 0 { panic("no return value specified for Foo") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(string, ...string) (string, error)); ok { return returnFunc(one, two...) } if returnFunc, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = returnFunc(one, two...) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(string, ...string) error); ok { r1 = returnFunc(one, two...) } else { r1 = ret.Error(1) } return r0, r1 } // MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call // - one string // - two ...string func (_e *MockVariadicWithMultipleReturnsUnrollVariadic_Expecter) Foo(one interface{}, two ...interface{}) *MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call { return &MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call{Call: _e.mock.On("Foo", append([]interface{}{one}, two...)...)} } func (_c *MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call) Run(run func(one string, two ...string)) *MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []string variadicArgs := make([]string, len(args)-1) for i, a := range args[1:] { if a != nil { variadicArgs[i] = a.(string) } } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call) Return(result string, err error) *MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call { _c.Call.Return(result, err) return _c } func (_c *MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call) RunAndReturn(run func(one string, two ...string) (string, error)) *MockVariadicWithMultipleReturnsUnrollVariadic_Foo_Call { _c.Call.Return(run) return _c } // NewMockVariadicWithMultipleReturns creates a new instance of MockVariadicWithMultipleReturns. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockVariadicWithMultipleReturns(t interface { mock.TestingT Cleanup(func()) }) *MockVariadicWithMultipleReturns { mock := &MockVariadicWithMultipleReturns{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockVariadicWithMultipleReturns is an autogenerated mock type for the VariadicWithMultipleReturns type type MockVariadicWithMultipleReturns struct { mock.Mock } type MockVariadicWithMultipleReturns_Expecter struct { mock *mock.Mock } func (_m *MockVariadicWithMultipleReturns) EXPECT() *MockVariadicWithMultipleReturns_Expecter { return &MockVariadicWithMultipleReturns_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockVariadicWithMultipleReturns func (_mock *MockVariadicWithMultipleReturns) Foo(one string, two ...string) (string, error) { var tmpRet mock.Arguments if len(two) > 0 { tmpRet = _mock.Called(one, two) } else { tmpRet = _mock.Called(one) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for Foo") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(string, ...string) (string, error)); ok { return returnFunc(one, two...) } if returnFunc, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = returnFunc(one, two...) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(string, ...string) error); ok { r1 = returnFunc(one, two...) } else { r1 = ret.Error(1) } return r0, r1 } // MockVariadicWithMultipleReturns_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockVariadicWithMultipleReturns_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call // - one string // - two ...string func (_e *MockVariadicWithMultipleReturns_Expecter) Foo(one interface{}, two ...interface{}) *MockVariadicWithMultipleReturns_Foo_Call { return &MockVariadicWithMultipleReturns_Foo_Call{Call: _e.mock.On("Foo", append([]interface{}{one}, two...)...)} } func (_c *MockVariadicWithMultipleReturns_Foo_Call) Run(run func(one string, two ...string)) *MockVariadicWithMultipleReturns_Foo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []string var variadicArgs []string if len(args) > 1 { variadicArgs = args[1].([]string) } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockVariadicWithMultipleReturns_Foo_Call) Return(result string, err error) *MockVariadicWithMultipleReturns_Foo_Call { _c.Call.Return(result, err) return _c } func (_c *MockVariadicWithMultipleReturns_Foo_Call) RunAndReturn(run func(one string, two ...string) (string, error)) *MockVariadicWithMultipleReturns_Foo_Call { _c.Call.Return(run) return _c } // NewMockVariadicWithNoReturns creates a new instance of MockVariadicWithNoReturns. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockVariadicWithNoReturns(t interface { mock.TestingT Cleanup(func()) }) *MockVariadicWithNoReturns { mock := &MockVariadicWithNoReturns{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockVariadicWithNoReturns is an autogenerated mock type for the VariadicWithNoReturns type type MockVariadicWithNoReturns struct { mock.Mock } type MockVariadicWithNoReturns_Expecter struct { mock *mock.Mock } func (_m *MockVariadicWithNoReturns) EXPECT() *MockVariadicWithNoReturns_Expecter { return &MockVariadicWithNoReturns_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockVariadicWithNoReturns func (_mock *MockVariadicWithNoReturns) Foo(one string, two ...string) { // string _va := make([]interface{}, len(two)) for _i := range two { _va[_i] = two[_i] } var _ca []interface{} _ca = append(_ca, one) _ca = append(_ca, _va...) _mock.Called(_ca...) return } // MockVariadicWithNoReturns_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockVariadicWithNoReturns_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call // - one string // - two ...string func (_e *MockVariadicWithNoReturns_Expecter) Foo(one interface{}, two ...interface{}) *MockVariadicWithNoReturns_Foo_Call { return &MockVariadicWithNoReturns_Foo_Call{Call: _e.mock.On("Foo", append([]interface{}{one}, two...)...)} } func (_c *MockVariadicWithNoReturns_Foo_Call) Run(run func(one string, two ...string)) *MockVariadicWithNoReturns_Foo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 []string variadicArgs := make([]string, len(args)-1) for i, a := range args[1:] { if a != nil { variadicArgs[i] = a.(string) } } arg1 = variadicArgs run( arg0, arg1..., ) }) return _c } func (_c *MockVariadicWithNoReturns_Foo_Call) Return() *MockVariadicWithNoReturns_Foo_Call { _c.Call.Return() return _c } func (_c *MockVariadicWithNoReturns_Foo_Call) RunAndReturn(run func(one string, two ...string)) *MockVariadicWithNoReturns_Foo_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/multi_template/README.md ================================================ This package tests that mockery can render different templates for the same interface. ================================================ FILE: internal/fixtures/multi_template/interface.go ================================================ package multitemplate type Foo interface { Bar() string } ================================================ FILE: internal/fixtures/multi_template/interface_test.go ================================================ package multitemplate import ( "testing" "github.com/stretchr/testify/assert" ) func TestFoo(t *testing.T) { testifyMock := NewMockTestifyFoo(t) testifyMock.EXPECT().Bar().Return("bar") assert.Equal(t, "bar", testifyMock.Bar()) matryerMock := MockMatryerFoo{ BarFunc: func() string { return "bar" }, } assert.Equal(t, "bar", matryerMock.Bar()) } ================================================ FILE: internal/fixtures/multi_template/mocks_matryer_multitemplate_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer package multitemplate import ( "sync" ) // Ensure that MockMatryerFoo does implement Foo. // If this is not the case, regenerate this file with mockery. var _ Foo = &MockMatryerFoo{} // MockMatryerFoo is a mock implementation of Foo. // // func TestSomethingThatUsesFoo(t *testing.T) { // // // make and configure a mocked Foo // mockedFoo := &MockMatryerFoo{ // BarFunc: func() string { // panic("mock out the Bar method") // }, // } // // // use mockedFoo in code that requires Foo // // and then make assertions. // // } type MockMatryerFoo struct { // BarFunc mocks the Bar method. BarFunc func() string // calls tracks calls to the methods. calls struct { // Bar holds details about calls to the Bar method. Bar []struct { } } lockBar sync.RWMutex } // Bar calls BarFunc. func (mock *MockMatryerFoo) Bar() string { if mock.BarFunc == nil { panic("MockMatryerFoo.BarFunc: method is nil but Foo.Bar was just called") } callInfo := struct { }{} mock.lockBar.Lock() mock.calls.Bar = append(mock.calls.Bar, callInfo) mock.lockBar.Unlock() return mock.BarFunc() } // BarCalls gets all the calls that were made to Bar. // Check the length with: // // len(mockedFoo.BarCalls()) func (mock *MockMatryerFoo) BarCalls() []struct { } { var calls []struct { } mock.lockBar.RLock() calls = mock.calls.Bar mock.lockBar.RUnlock() return calls } ================================================ FILE: internal/fixtures/multi_template/mocks_testify_multitemplate_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package multitemplate import ( mock "github.com/stretchr/testify/mock" ) // NewMockTestifyFoo creates a new instance of MockTestifyFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockTestifyFoo(t interface { mock.TestingT Cleanup(func()) }) *MockTestifyFoo { mock := &MockTestifyFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockTestifyFoo is an autogenerated mock type for the Foo type type MockTestifyFoo struct { mock.Mock } type MockTestifyFoo_Expecter struct { mock *mock.Mock } func (_m *MockTestifyFoo) EXPECT() *MockTestifyFoo_Expecter { return &MockTestifyFoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockTestifyFoo func (_mock *MockTestifyFoo) Bar() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockTestifyFoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockTestifyFoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *MockTestifyFoo_Expecter) Bar() *MockTestifyFoo_Bar_Call { return &MockTestifyFoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *MockTestifyFoo_Bar_Call) Run(run func()) *MockTestifyFoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockTestifyFoo_Bar_Call) Return(s string) *MockTestifyFoo_Bar_Call { _c.Call.Return(s) return _c } func (_c *MockTestifyFoo_Bar_Call) RunAndReturn(run func() string) *MockTestifyFoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/nil_run.go ================================================ package test type NilRun interface { Foo(NilRun) } ================================================ FILE: internal/fixtures/nil_run_test.go ================================================ package test import ( "testing" "github.com/stretchr/testify/mock" ) func TestDoer(t *testing.T) { d := NewMockNilRun(t) d.EXPECT().Foo(mock.Anything).Run(func(_ NilRun) {}) d.Foo(nil) } ================================================ FILE: internal/fixtures/output_dir/interface.go ================================================ package output_dir type OutputDirWithDifferentPkgName interface { Foo() string } type OutputDirWithSamePkgNameAsSrc interface { Bar() string } type OutputDirWithinSrcPkg interface { Baz() string } ================================================ FILE: internal/fixtures/output_dir/interface_test.go ================================================ package output_dir_test import ( "os" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestOutputSourceImport(t *testing.T) { const expectedImport = "github.com/vektra/mockery/v3/internal/fixtures/output_dir" tests := []struct { name string filepath string expected bool }{ { name: "Different package name -outside source package", filepath: "./mock/mocks_matryer_output_dir_test.go", expected: true, }, { name: "Same package name -outside source package", filepath: "./output_dir/mocks_matryer_output_dir_test.go", expected: true, }, { name: "Same package name -within source package", filepath: "./mocks_matryer_output_dir_test.go", expected: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { b, err := os.ReadFile(tt.filepath) require.NoError(t, err) assert.Equal(t, tt.expected, strings.Contains(string(b), expectedImport)) }) } } func TestOutputEnsureCheck(t *testing.T) { tests := []struct { name string filepath string expected string }{ { name: "Different package name -outside source package", filepath: "./mock/mocks_matryer_output_dir_test.go", expected: "var _ output_dir.OutputDirWithDifferentPkgName = &MoqOutputDirWithDifferentPkgName{}", }, { name: "Same package name -outside source package", filepath: "./output_dir/mocks_matryer_output_dir_test.go", expected: "var _ output_dir.OutputDirWithSamePkgNameAsSrc = &MoqOutputDirWithSamePkgNameAsSrc{}", }, { name: "Same package name -within source package", filepath: "./mocks_matryer_output_dir_test.go", expected: "var _ OutputDirWithinSrcPkg = &MoqOutputDirWithinSrcPkg{}", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { b, err := os.ReadFile(tt.filepath) require.NoError(t, err) assert.Contains(t, string(b), tt.expected) }) } } ================================================ FILE: internal/fixtures/output_dir/mock/mocks_matryer_output_dir_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer package mock import ( "sync" "github.com/vektra/mockery/v3/internal/fixtures/output_dir" ) // Ensure that MoqOutputDirWithDifferentPkgName does implement output_dir.OutputDirWithDifferentPkgName. // If this is not the case, regenerate this file with mockery. var _ output_dir.OutputDirWithDifferentPkgName = &MoqOutputDirWithDifferentPkgName{} // MoqOutputDirWithDifferentPkgName is a mock implementation of output_dir.OutputDirWithDifferentPkgName. // // func TestSomethingThatUsesOutputDirWithDifferentPkgName(t *testing.T) { // // // make and configure a mocked output_dir.OutputDirWithDifferentPkgName // mockedOutputDirWithDifferentPkgName := &MoqOutputDirWithDifferentPkgName{ // FooFunc: func() string { // panic("mock out the Foo method") // }, // } // // // use mockedOutputDirWithDifferentPkgName in code that requires output_dir.OutputDirWithDifferentPkgName // // and then make assertions. // // } type MoqOutputDirWithDifferentPkgName struct { // FooFunc mocks the Foo method. FooFunc func() string // calls tracks calls to the methods. calls struct { // Foo holds details about calls to the Foo method. Foo []struct { } } lockFoo sync.RWMutex } // Foo calls FooFunc. func (mock *MoqOutputDirWithDifferentPkgName) Foo() string { callInfo := struct { }{} mock.lockFoo.Lock() mock.calls.Foo = append(mock.calls.Foo, callInfo) mock.lockFoo.Unlock() if mock.FooFunc == nil { var ( s string ) return s } return mock.FooFunc() } // FooCalls gets all the calls that were made to Foo. // Check the length with: // // len(mockedOutputDirWithDifferentPkgName.FooCalls()) func (mock *MoqOutputDirWithDifferentPkgName) FooCalls() []struct { } { var calls []struct { } mock.lockFoo.RLock() calls = mock.calls.Foo mock.lockFoo.RUnlock() return calls } // ResetFooCalls reset all the calls that were made to Foo. func (mock *MoqOutputDirWithDifferentPkgName) ResetFooCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqOutputDirWithDifferentPkgName) ResetCalls() { mock.lockFoo.Lock() mock.calls.Foo = nil mock.lockFoo.Unlock() } ================================================ FILE: internal/fixtures/output_dir/mocks_matryer_output_dir_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer package output_dir import ( "sync" ) // Ensure that MoqOutputDirWithinSrcPkg does implement OutputDirWithinSrcPkg. // If this is not the case, regenerate this file with mockery. var _ OutputDirWithinSrcPkg = &MoqOutputDirWithinSrcPkg{} // MoqOutputDirWithinSrcPkg is a mock implementation of OutputDirWithinSrcPkg. // // func TestSomethingThatUsesOutputDirWithinSrcPkg(t *testing.T) { // // // make and configure a mocked OutputDirWithinSrcPkg // mockedOutputDirWithinSrcPkg := &MoqOutputDirWithinSrcPkg{ // BazFunc: func() string { // panic("mock out the Baz method") // }, // } // // // use mockedOutputDirWithinSrcPkg in code that requires OutputDirWithinSrcPkg // // and then make assertions. // // } type MoqOutputDirWithinSrcPkg struct { // BazFunc mocks the Baz method. BazFunc func() string // calls tracks calls to the methods. calls struct { // Baz holds details about calls to the Baz method. Baz []struct { } } lockBaz sync.RWMutex } // Baz calls BazFunc. func (mock *MoqOutputDirWithinSrcPkg) Baz() string { callInfo := struct { }{} mock.lockBaz.Lock() mock.calls.Baz = append(mock.calls.Baz, callInfo) mock.lockBaz.Unlock() if mock.BazFunc == nil { var ( s string ) return s } return mock.BazFunc() } // BazCalls gets all the calls that were made to Baz. // Check the length with: // // len(mockedOutputDirWithinSrcPkg.BazCalls()) func (mock *MoqOutputDirWithinSrcPkg) BazCalls() []struct { } { var calls []struct { } mock.lockBaz.RLock() calls = mock.calls.Baz mock.lockBaz.RUnlock() return calls } // ResetBazCalls reset all the calls that were made to Baz. func (mock *MoqOutputDirWithinSrcPkg) ResetBazCalls() { mock.lockBaz.Lock() mock.calls.Baz = nil mock.lockBaz.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqOutputDirWithinSrcPkg) ResetCalls() { mock.lockBaz.Lock() mock.calls.Baz = nil mock.lockBaz.Unlock() } ================================================ FILE: internal/fixtures/output_dir/output_dir/mocks_matryer_output_dir_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer package output_dir import ( "sync" "github.com/vektra/mockery/v3/internal/fixtures/output_dir" ) // Ensure that MoqOutputDirWithSamePkgNameAsSrc does implement output_dir.OutputDirWithSamePkgNameAsSrc. // If this is not the case, regenerate this file with mockery. var _ output_dir.OutputDirWithSamePkgNameAsSrc = &MoqOutputDirWithSamePkgNameAsSrc{} // MoqOutputDirWithSamePkgNameAsSrc is a mock implementation of output_dir.OutputDirWithSamePkgNameAsSrc. // // func TestSomethingThatUsesOutputDirWithSamePkgNameAsSrc(t *testing.T) { // // // make and configure a mocked output_dir.OutputDirWithSamePkgNameAsSrc // mockedOutputDirWithSamePkgNameAsSrc := &MoqOutputDirWithSamePkgNameAsSrc{ // BarFunc: func() string { // panic("mock out the Bar method") // }, // } // // // use mockedOutputDirWithSamePkgNameAsSrc in code that requires output_dir.OutputDirWithSamePkgNameAsSrc // // and then make assertions. // // } type MoqOutputDirWithSamePkgNameAsSrc struct { // BarFunc mocks the Bar method. BarFunc func() string // calls tracks calls to the methods. calls struct { // Bar holds details about calls to the Bar method. Bar []struct { } } lockBar sync.RWMutex } // Bar calls BarFunc. func (mock *MoqOutputDirWithSamePkgNameAsSrc) Bar() string { callInfo := struct { }{} mock.lockBar.Lock() mock.calls.Bar = append(mock.calls.Bar, callInfo) mock.lockBar.Unlock() if mock.BarFunc == nil { var ( s string ) return s } return mock.BarFunc() } // BarCalls gets all the calls that were made to Bar. // Check the length with: // // len(mockedOutputDirWithSamePkgNameAsSrc.BarCalls()) func (mock *MoqOutputDirWithSamePkgNameAsSrc) BarCalls() []struct { } { var calls []struct { } mock.lockBar.RLock() calls = mock.calls.Bar mock.lockBar.RUnlock() return calls } // ResetBarCalls reset all the calls that were made to Bar. func (mock *MoqOutputDirWithSamePkgNameAsSrc) ResetBarCalls() { mock.lockBar.Lock() mock.calls.Bar = nil mock.lockBar.Unlock() } // ResetCalls reset all the calls that were made to all mocked methods. func (mock *MoqOutputDirWithSamePkgNameAsSrc) ResetCalls() { mock.lockBar.Lock() mock.calls.Bar = nil mock.lockBar.Unlock() } ================================================ FILE: internal/fixtures/panic_err.go ================================================ package test type PanicOnNoReturnValue interface { DoSomething() string } ================================================ FILE: internal/fixtures/panic_err_test.go ================================================ package test import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestPanicOnNoReturnValue(t *testing.T) { m := NewMockPanicOnNoReturnValue(t) m.EXPECT().DoSomething() var panicOccurred bool defer func() { assert.True(t, panicOccurred) }() defer func() { panicOccurred = true r := recover() require.NotNil(t, r) assert.Equal(t, "no return value specified for DoSomething", r.(string)) }() m.DoSomething() } ================================================ FILE: internal/fixtures/pkg_with_no_files/subpkg/foo.go ================================================ package foo ================================================ FILE: internal/fixtures/recursive_generation/foo.go ================================================ package recursive_generation type Foo interface { Get() string } ================================================ FILE: internal/fixtures/recursive_generation/mocks_testify_recursive_generation_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package recursive_generation import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockFoo func (_mock *MockFoo) Get() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockFoo_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockFoo_Expecter) Get() *MockFoo_Get_Call { return &MockFoo_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockFoo_Get_Call) Run(run func()) *MockFoo_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Get_Call) Return(s string) *MockFoo_Get_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Get_Call) RunAndReturn(run func() string) *MockFoo_Get_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/recursive_generation/subpkg1/foo.go ================================================ package subpkg1 type Foo interface { Get() string } ================================================ FILE: internal/fixtures/recursive_generation/subpkg1/mocks_testify_subpkg1_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package subpkg1 import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockFoo func (_mock *MockFoo) Get() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockFoo_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockFoo_Expecter) Get() *MockFoo_Get_Call { return &MockFoo_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockFoo_Get_Call) Run(run func()) *MockFoo_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Get_Call) Return(s string) *MockFoo_Get_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Get_Call) RunAndReturn(run func() string) *MockFoo_Get_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/recursive_generation/subpkg2/foo.go ================================================ package subpkg2 type Foo interface { Get() string } ================================================ FILE: internal/fixtures/recursive_generation/subpkg2/mocks_testify_subpkg2_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package subpkg2 import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Get provides a mock function for the type MockFoo func (_mock *MockFoo) Get() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Get") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockFoo_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call func (_e *MockFoo_Expecter) Get() *MockFoo_Get_Call { return &MockFoo_Get_Call{Call: _e.mock.On("Get")} } func (_c *MockFoo_Get_Call) Run(run func()) *MockFoo_Get_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Get_Call) Return(s string) *MockFoo_Get_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Get_Call) RunAndReturn(run func() string) *MockFoo_Get_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/recursive_generation/subpkg_with_only_autogenerated_files/foo.go ================================================ // Code generated by an arbitrary code generator thingy. DO NOT EDIT. package subpkg_with_only_autogenerated_files type Foo interface { Get() string } ================================================ FILE: internal/fixtures/recursive_generation_with_subpkg_exclude/foo.go ================================================ package recursivegenerationwithsubpkgexclude type Foo interface { Bar() string } ================================================ FILE: internal/fixtures/recursive_generation_with_subpkg_exclude/foo_test.go ================================================ package recursivegenerationwithsubpkgexclude_test import ( "os" "path" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vektra/mockery/v3/internal/file" ) func TestSubpkg2NotExist(t *testing.T) { wd, err := os.Getwd() require.NoError(t, err) subpkg2MockFile := path.Join(wd, "subpkg2", "mocks.go") exists, err := file.Exists(subpkg2MockFile) require.NoError(t, err) assert.False(t, exists, "subpkg2 mocks.go file exists when it shouldn't") } func TestSubpkg1Exists(t *testing.T) { wd, err := os.Getwd() require.NoError(t, err) subpkg2MockFile := path.Join(wd, "subpkg1", "mocks.go") exists, err := file.Exists(subpkg2MockFile) require.NoError(t, err) assert.True(t, exists, "subpkg1 mocks.go file doesn't exist when it should") } ================================================ FILE: internal/fixtures/recursive_generation_with_subpkg_exclude/mocks.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package recursivegenerationwithsubpkgexclude import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockFoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *MockFoo_Expecter) Bar() *MockFoo_Bar_Call { return &MockFoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *MockFoo_Bar_Call) Run(run func()) *MockFoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Bar_Call) Return(s string) *MockFoo_Bar_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Bar_Call) RunAndReturn(run func() string) *MockFoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/recursive_generation_with_subpkg_exclude/subpkg1/foo.go ================================================ package subpkg1 type Foo interface { Bar() string } ================================================ FILE: internal/fixtures/recursive_generation_with_subpkg_exclude/subpkg1/mocks.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package subpkg1 import ( mock "github.com/stretchr/testify/mock" ) // NewMockFoo creates a new instance of MockFoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockFoo(t interface { mock.TestingT Cleanup(func()) }) *MockFoo { mock := &MockFoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFoo is an autogenerated mock type for the Foo type type MockFoo struct { mock.Mock } type MockFoo_Expecter struct { mock *mock.Mock } func (_m *MockFoo) EXPECT() *MockFoo_Expecter { return &MockFoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type MockFoo func (_mock *MockFoo) Bar() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockFoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type MockFoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *MockFoo_Expecter) Bar() *MockFoo_Bar_Call { return &MockFoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *MockFoo_Bar_Call) Run(run func()) *MockFoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockFoo_Bar_Call) Return(s string) *MockFoo_Bar_Call { _c.Call.Return(s) return _c } func (_c *MockFoo_Bar_Call) RunAndReturn(run func() string) *MockFoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/recursive_generation_with_subpkg_exclude/subpkg2/foo.go ================================================ package subpkg2 type Foo interface { Bar() string } ================================================ FILE: internal/fixtures/redefined_type_b/redefined_type_b.go ================================================ package test // This is testing imports of the "B" type, which is also defined in // pkg/fixtures type B int ================================================ FILE: internal/fixtures/replace_type_pointers/interface.go ================================================ package replace_type_pointers type ( Foo int Bar int ) type InterfaceWithPointers interface { FooFunc(*Foo) *Foo BarFunc(Bar) Bar } ================================================ FILE: internal/fixtures/replace_type_pointers/interface_test.go ================================================ package replace_type_pointers import ( "os" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestReplaceTypePointers(t *testing.T) { // The config file has been written to replace all instances of the Foo type // with Bar. We check whether the function signatures indeed have *Foo // replaced with *Bar in both the argument and return value parameters. mockFile := "mocks_testify_replace_type_pointers_test.go" mockFileBytes, err := os.ReadFile(mockFile) require.NoError(t, err) assert.Contains(t, string(mockFileBytes), "FooFunc(foo *Bar) *Bar") } ================================================ FILE: internal/fixtures/replace_type_pointers/mocks_testify_replace_type_pointers_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package replace_type_pointers import ( mock "github.com/stretchr/testify/mock" ) // NewMockInterfaceWithPointers creates a new instance of MockInterfaceWithPointers. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockInterfaceWithPointers(t interface { mock.TestingT Cleanup(func()) }) *MockInterfaceWithPointers { mock := &MockInterfaceWithPointers{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockInterfaceWithPointers is an autogenerated mock type for the InterfaceWithPointers type type MockInterfaceWithPointers struct { mock.Mock } type MockInterfaceWithPointers_Expecter struct { mock *mock.Mock } func (_m *MockInterfaceWithPointers) EXPECT() *MockInterfaceWithPointers_Expecter { return &MockInterfaceWithPointers_Expecter{mock: &_m.Mock} } // BarFunc provides a mock function for the type MockInterfaceWithPointers func (_mock *MockInterfaceWithPointers) BarFunc(bar Bar) Bar { ret := _mock.Called(bar) if len(ret) == 0 { panic("no return value specified for BarFunc") } var r0 Bar if returnFunc, ok := ret.Get(0).(func(Bar) Bar); ok { r0 = returnFunc(bar) } else { r0 = ret.Get(0).(Bar) } return r0 } // MockInterfaceWithPointers_BarFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BarFunc' type MockInterfaceWithPointers_BarFunc_Call struct { *mock.Call } // BarFunc is a helper method to define mock.On call // - bar Bar func (_e *MockInterfaceWithPointers_Expecter) BarFunc(bar interface{}) *MockInterfaceWithPointers_BarFunc_Call { return &MockInterfaceWithPointers_BarFunc_Call{Call: _e.mock.On("BarFunc", bar)} } func (_c *MockInterfaceWithPointers_BarFunc_Call) Run(run func(bar Bar)) *MockInterfaceWithPointers_BarFunc_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 Bar if args[0] != nil { arg0 = args[0].(Bar) } run( arg0, ) }) return _c } func (_c *MockInterfaceWithPointers_BarFunc_Call) Return(bar1 Bar) *MockInterfaceWithPointers_BarFunc_Call { _c.Call.Return(bar1) return _c } func (_c *MockInterfaceWithPointers_BarFunc_Call) RunAndReturn(run func(bar Bar) Bar) *MockInterfaceWithPointers_BarFunc_Call { _c.Call.Return(run) return _c } // FooFunc provides a mock function for the type MockInterfaceWithPointers func (_mock *MockInterfaceWithPointers) FooFunc(foo *Bar) *Bar { ret := _mock.Called(foo) if len(ret) == 0 { panic("no return value specified for FooFunc") } var r0 *Bar if returnFunc, ok := ret.Get(0).(func(*Bar) *Bar); ok { r0 = returnFunc(foo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*Bar) } } return r0 } // MockInterfaceWithPointers_FooFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FooFunc' type MockInterfaceWithPointers_FooFunc_Call struct { *mock.Call } // FooFunc is a helper method to define mock.On call // - foo *Bar func (_e *MockInterfaceWithPointers_Expecter) FooFunc(foo interface{}) *MockInterfaceWithPointers_FooFunc_Call { return &MockInterfaceWithPointers_FooFunc_Call{Call: _e.mock.On("FooFunc", foo)} } func (_c *MockInterfaceWithPointers_FooFunc_Call) Run(run func(foo *Bar)) *MockInterfaceWithPointers_FooFunc_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 *Bar if args[0] != nil { arg0 = args[0].(*Bar) } run( arg0, ) }) return _c } func (_c *MockInterfaceWithPointers_FooFunc_Call) Return(foo1 *Bar) *MockInterfaceWithPointers_FooFunc_Call { _c.Call.Return(foo1) return _c } func (_c *MockInterfaceWithPointers_FooFunc_Call) RunAndReturn(run func(foo *Bar) *Bar) *MockInterfaceWithPointers_FooFunc_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/requester.go ================================================ package test type Requester interface { Get(path string) (string, error) } ================================================ FILE: internal/fixtures/requester2.go ================================================ package test type Requester2 interface { Get(path string) error } ================================================ FILE: internal/fixtures/requester3.go ================================================ package test type Requester3 interface { Get() error } ================================================ FILE: internal/fixtures/requester4.go ================================================ package test type Requester4 interface { Get() } ================================================ FILE: internal/fixtures/requester_arg_same_as_import.go ================================================ package test import "encoding/json" type RequesterArgSameAsImport interface { Get(json string) *json.RawMessage } ================================================ FILE: internal/fixtures/requester_arg_same_as_named_import.go ================================================ package test import "encoding/json" type RequesterArgSameAsNamedImport interface { Get(json string) *json.RawMessage } ================================================ FILE: internal/fixtures/requester_arg_same_as_pkg.go ================================================ package test type RequesterArgSameAsPkg interface { Get(test string) } ================================================ FILE: internal/fixtures/requester_array.go ================================================ package test type RequesterArray interface { Get(path string) ([2]string, error) } ================================================ FILE: internal/fixtures/requester_elided.go ================================================ package test type RequesterElided interface { Get(path, url string) error } ================================================ FILE: internal/fixtures/requester_iface.go ================================================ package test import "io" type RequesterIface interface { Get() io.Reader } ================================================ FILE: internal/fixtures/requester_ns.go ================================================ package test import "net/http" type RequesterNS interface { Get(path string) (http.Response, error) } ================================================ FILE: internal/fixtures/requester_ptr.go ================================================ package test type RequesterPtr interface { Get(path string) (*string, error) } ================================================ FILE: internal/fixtures/requester_ret_elided.go ================================================ package test type RequesterReturnElided interface { Get(path string) (a, b, c int, err error) Put(path string) (_ int, err error) } ================================================ FILE: internal/fixtures/requester_slice.go ================================================ package test type RequesterSlice interface { Get(path string) ([]string, error) } ================================================ FILE: internal/fixtures/requester_test.go ================================================ package test import ( "fmt" "testing" "github.com/stretchr/testify/assert" mock "github.com/stretchr/testify/mock" ) func TestRequesterMock(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get("foo").Return("bar", nil).Once() retString, err := m.Get("foo") assert.NoError(t, err) assert.Equal(t, "bar", retString) } func TestRequesterMockRunAndReturn(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get(mock.Anything).RunAndReturn(func(path string) (string, error) { return path + " world", nil }) retString, err := m.Get("hello") assert.NoError(t, err) assert.Equal(t, "hello world", retString) } func TestRequesterMockRun(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get(mock.Anything).Return("", nil) m.EXPECT().Get(mock.Anything).Run(func(path string) { fmt.Printf("Side effect! Argument is: %s", path) }) retString, err := m.Get("hello") assert.NoError(t, err) assert.Equal(t, "", retString) } //nolint:errcheck func TestRequesterMockTestifyEmbed(t *testing.T) { m := NewMockRequester(t) m.EXPECT().Get(mock.Anything).Return("", nil).Twice() m.Get("hello") m.Get("world") assert.Len(t, m.Mock.Calls, 2) } func TestRequesterMoq(t *testing.T) { m := &MoqRequester{ GetFunc: func(path string) (string, error) { fmt.Printf("Go path: %s\n", path) return path + "/foo", nil }, } result, err := m.Get("/path") assert.NoError(t, err) assert.Equal(t, "/path/foo", result) } func TestRequesterMatryerStub(t *testing.T) { m := &StubMatyerRequester{} // The returned values should be the zero-values even though a GetFunc was // not defined. If stub-impl is not true, this should panic. str, err := m.Get("foo") assert.Equal(t, "", str) assert.Equal(t, nil, err) } ================================================ FILE: internal/fixtures/requester_unexported.go ================================================ package test type requesterUnexported interface { Get() } ================================================ FILE: internal/fixtures/requester_variadic.go ================================================ package test import "io" type RequesterVariadic interface { // cases: only variadic argument, w/ and w/out interface type Get(values ...string) bool OneInterface(a ...interface{}) bool // cases: normal argument + variadic argument, w/ and w/o interface type Sprintf(format string, a ...interface{}) string MultiWriteToFile(filename string, w ...io.Writer) string } ================================================ FILE: internal/fixtures/same_name_imports.go ================================================ package test import ( "net/http" number_dir_http "github.com/vektra/mockery/v3/internal/fixtures/12345678/http" my_http "github.com/vektra/mockery/v3/internal/fixtures/http" ) // Example is an example type Example interface { A() http.Flusher B(fixtureshttp string) my_http.MyStruct C(fixtureshttp string) number_dir_http.MyStruct } ================================================ FILE: internal/fixtures/struct_value.go ================================================ package test type B struct{} type A interface { Call() (B, error) } ================================================ FILE: internal/fixtures/struct_with_tag.go ================================================ package test type StructWithTag interface { MethodA(v *struct { FieldA int `json:"field_a"` FieldB int `json:"field_b" xml:"field_b"` }) *struct { FieldC int `json:"field_c"` FieldD int `json:"field_d" xml:"field_d"` } } ================================================ FILE: internal/fixtures/template_exercise/exercise.go ================================================ package templateexercise import ( "context" "golang.org/x/exp/constraints" ) // GenDecl comments type ( // Exercise is an interface that is used to render a template that exercises // all parts of the template data passed to the template. Exercise[T any, Ordered constraints.Ordered] interface { // Foo is a foo Foo(ctx context.Context, typeParam T, ordered Ordered) error } // This is a line comment ) ================================================ FILE: internal/fixtures/type_alias/interface.go ================================================ package type_alias import "github.com/vektra/mockery/v3/internal/fixtures/type_alias/subpkg" type ( Type = int S = subpkg.S AliasToInterface3 = subpkg.Interface3 ) type Interface1 interface { Foo() Type } type Interface2 interface { F(Type, S, subpkg.S) } ================================================ FILE: internal/fixtures/type_alias/interface_test.go ================================================ package type_alias_test import ( "os" "regexp" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vektra/mockery/v3/internal/fixtures/type_alias" ) func TestTypeAliasInMethodReturn(t *testing.T) { for _, tt := range []struct { name string filepath string expectedRegex string }{ { name: "With alias unresolved", filepath: "./mocks_testify_type_alias_test.go", expectedRegex: `func \(_mock \*MockInterface1\) Foo\(\) Type {`, }, } { t.Run(tt.name, func(t *testing.T) { regex, err := regexp.Compile(tt.expectedRegex) require.NoError(t, err) bytes, err := os.ReadFile(tt.filepath) require.NoError(t, err) assert.True(t, regex.Match(bytes), "expected regex was not found in file") }) } } func TestTypeAliasMock(t *testing.T) { m := type_alias.NewMockAliasToInterface3(t) m.EXPECT().Foo().Return("foo") assert.Equal(t, "foo", m.Foo()) } ================================================ FILE: internal/fixtures/type_alias/mocks_testify_type_alias_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package type_alias import ( mock "github.com/stretchr/testify/mock" "github.com/vektra/mockery/v3/internal/fixtures/type_alias/subpkg" ) // NewMockAliasToInterface3 creates a new instance of MockAliasToInterface3. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockAliasToInterface3(t interface { mock.TestingT Cleanup(func()) }) *MockAliasToInterface3 { mock := &MockAliasToInterface3{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockAliasToInterface3 is an autogenerated mock type for the AliasToInterface3 type type MockAliasToInterface3 struct { mock.Mock } type MockAliasToInterface3_Expecter struct { mock *mock.Mock } func (_m *MockAliasToInterface3) EXPECT() *MockAliasToInterface3_Expecter { return &MockAliasToInterface3_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockAliasToInterface3 func (_mock *MockAliasToInterface3) Foo() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Foo") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // MockAliasToInterface3_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockAliasToInterface3_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call func (_e *MockAliasToInterface3_Expecter) Foo() *MockAliasToInterface3_Foo_Call { return &MockAliasToInterface3_Foo_Call{Call: _e.mock.On("Foo")} } func (_c *MockAliasToInterface3_Foo_Call) Run(run func()) *MockAliasToInterface3_Foo_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockAliasToInterface3_Foo_Call) Return(s string) *MockAliasToInterface3_Foo_Call { _c.Call.Return(s) return _c } func (_c *MockAliasToInterface3_Foo_Call) RunAndReturn(run func() string) *MockAliasToInterface3_Foo_Call { _c.Call.Return(run) return _c } // NewMockInterface1 creates a new instance of MockInterface1. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockInterface1(t interface { mock.TestingT Cleanup(func()) }) *MockInterface1 { mock := &MockInterface1{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockInterface1 is an autogenerated mock type for the Interface1 type type MockInterface1 struct { mock.Mock } type MockInterface1_Expecter struct { mock *mock.Mock } func (_m *MockInterface1) EXPECT() *MockInterface1_Expecter { return &MockInterface1_Expecter{mock: &_m.Mock} } // Foo provides a mock function for the type MockInterface1 func (_mock *MockInterface1) Foo() Type { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Foo") } var r0 Type if returnFunc, ok := ret.Get(0).(func() Type); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(Type) } return r0 } // MockInterface1_Foo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Foo' type MockInterface1_Foo_Call struct { *mock.Call } // Foo is a helper method to define mock.On call func (_e *MockInterface1_Expecter) Foo() *MockInterface1_Foo_Call { return &MockInterface1_Foo_Call{Call: _e.mock.On("Foo")} } func (_c *MockInterface1_Foo_Call) Run(run func()) *MockInterface1_Foo_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockInterface1_Foo_Call) Return(v Type) *MockInterface1_Foo_Call { _c.Call.Return(v) return _c } func (_c *MockInterface1_Foo_Call) RunAndReturn(run func() Type) *MockInterface1_Foo_Call { _c.Call.Return(run) return _c } // NewMockInterface2 creates a new instance of MockInterface2. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockInterface2(t interface { mock.TestingT Cleanup(func()) }) *MockInterface2 { mock := &MockInterface2{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockInterface2 is an autogenerated mock type for the Interface2 type type MockInterface2 struct { mock.Mock } type MockInterface2_Expecter struct { mock *mock.Mock } func (_m *MockInterface2) EXPECT() *MockInterface2_Expecter { return &MockInterface2_Expecter{mock: &_m.Mock} } // F provides a mock function for the type MockInterface2 func (_mock *MockInterface2) F(v Type, v1 S, s subpkg.S) { _mock.Called(v, v1, s) return } // MockInterface2_F_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'F' type MockInterface2_F_Call struct { *mock.Call } // F is a helper method to define mock.On call // - v Type // - v1 S // - s subpkg.S func (_e *MockInterface2_Expecter) F(v interface{}, v1 interface{}, s interface{}) *MockInterface2_F_Call { return &MockInterface2_F_Call{Call: _e.mock.On("F", v, v1, s)} } func (_c *MockInterface2_F_Call) Run(run func(v Type, v1 S, s subpkg.S)) *MockInterface2_F_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 Type if args[0] != nil { arg0 = args[0].(Type) } var arg1 S if args[1] != nil { arg1 = args[1].(S) } var arg2 subpkg.S if args[2] != nil { arg2 = args[2].(subpkg.S) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockInterface2_F_Call) Return() *MockInterface2_F_Call { _c.Call.Return() return _c } func (_c *MockInterface2_F_Call) RunAndReturn(run func(v Type, v1 S, s subpkg.S)) *MockInterface2_F_Call { _c.Run(run) return _c } ================================================ FILE: internal/fixtures/type_alias/subpkg/interface.go ================================================ package subpkg type S struct { A int } type Interface3 interface { Foo() string } ================================================ FILE: internal/fixtures/unexported/interface.go ================================================ package unexported type foo interface { Bar() string } ================================================ FILE: internal/fixtures/unexported/interface_test.go ================================================ package unexported import ( "os" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestUnexportedConstructorName(t *testing.T) { mockFile := "./mocks_testify_unexported_test.go" b, err := os.ReadFile(mockFile) require.NoError(t, err) assert.True(t, strings.Contains(string(b), "func newMockfoo(")) } ================================================ FILE: internal/fixtures/unexported/mocks_testify_unexported_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package unexported import ( mock "github.com/stretchr/testify/mock" ) // newMockfoo creates a new instance of mockfoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockfoo(t interface { mock.TestingT Cleanup(func()) }) *mockfoo { mock := &mockfoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // mockfoo is an autogenerated mock type for the foo type type mockfoo struct { mock.Mock } type mockfoo_Expecter struct { mock *mock.Mock } func (_m *mockfoo) EXPECT() *mockfoo_Expecter { return &mockfoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type mockfoo func (_mock *mockfoo) Bar() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // mockfoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type mockfoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *mockfoo_Expecter) Bar() *mockfoo_Bar_Call { return &mockfoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *mockfoo_Bar_Call) Run(run func()) *mockfoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *mockfoo_Bar_Call) Return(s string) *mockfoo_Bar_Call { _c.Call.Return(s) return _c } func (_c *mockfoo_Bar_Call) RunAndReturn(run func() string) *mockfoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: internal/fixtures/unsafe.go ================================================ package test import "unsafe" type UnsafeInterface interface { Do(ptr *unsafe.Pointer) } ================================================ FILE: internal/fixtures/variadic.go ================================================ package test type VariadicFunction = func(args1 string, args2 ...interface{}) interface{} type Variadic interface { VariadicFunction(str string, vFunc VariadicFunction) error } ================================================ FILE: internal/fixtures/variadic_return_func.go ================================================ package test type VariadicReturnFunc interface { SampleMethod(str string) func(str string, arr []int, a ...interface{}) } ================================================ FILE: internal/fixtures/variadic_return_func_test.go ================================================ package test import ( "testing" "github.com/stretchr/testify/assert" ) func TestVariadicReturnFunc(t *testing.T) { m := NewMockVariadicReturnFunc(t) m.EXPECT().SampleMethod("").Return(func(s string, l []int, a ...any) { assert.Equal(t, "foo", s) assert.Equal(t, []int{1, 2, 3}, l) assert.Equal(t, []any{"one", "two", "three"}, a) }) m.SampleMethod("")("foo", []int{1, 2, 3}, "one", "two", "three") } ================================================ FILE: internal/fixtures/variadic_with_multiple_returns.go ================================================ package test type VariadicWithMultipleReturns interface { Foo(one string, two ...string) (result string, err error) } ================================================ FILE: internal/fixtures/variadic_with_multiple_returns_test.go ================================================ package test import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) func TestNoUnrollVariadic(t *testing.T) { m := NewMockVariadicWithMultipleReturns(t) m.EXPECT().Foo(mock.Anything, mock.Anything).RunAndReturn( func(one string, two ...string) (string, error) { var s string = one for _, t := range two { s += t } return s, nil }, ) ret, err := m.Foo("one", "two", "three") assert.NoError(t, err) assert.Equal(t, "onetwothree", ret) } func TestUnrollVariadic(t *testing.T) { m := NewMockVariadicWithMultipleReturnsUnrollVariadic(t) m.EXPECT().Foo(mock.Anything, mock.Anything, mock.Anything).RunAndReturn( func(one string, two ...string) (string, error) { var s string = one for _, t := range two { s += t } return s, nil }, ) ret, err := m.Foo("one", "two", "three") assert.NoError(t, err) assert.Equal(t, "onetwothree", ret) } func TestUnrollVariadicRun(t *testing.T) { var ran bool m := NewMockVariadicWithMultipleReturnsUnrollVariadic(t) m.EXPECT().Foo(mock.Anything, mock.Anything, mock.Anything).Run( func(one string, two ...string) { ran = true }, ).Return("", nil) //nolint: errcheck m.Foo("", "") assert.True(t, ran) } func TestNoUnrollVariadicRun(t *testing.T) { var ran bool m := NewMockVariadicWithMultipleReturns(t) m.EXPECT().Foo(mock.Anything, mock.Anything).Run( func(one string, two ...string) { ran = true }, ).Return("", nil) //nolint: errcheck m.Foo("", "") assert.True(t, ran) } func TestNoUnrollVariadicWithNoVariadicArgument(t *testing.T) { var ran bool m := NewMockVariadicWithMultipleReturns(t) m.EXPECT().Foo(mock.Anything, mock.Anything).Run( func(one string, two ...string) { ran = true }, ).Return("", nil) //nolint: errcheck m.Foo("") assert.True(t, ran) } ================================================ FILE: internal/fixtures/variadic_with_no_returns.go ================================================ package test type VariadicWithNoReturns interface { Foo(one string, two ...string) } ================================================ FILE: internal/interface.go ================================================ package internal import ( "go/ast" "github.com/vektra/mockery/v3/config" "golang.org/x/tools/go/packages" ) type Interface struct { Name string // Name of the type to be mocked. TypeSpec *ast.TypeSpec GenDecl *ast.GenDecl FilePath string FileSyntax *ast.File Pkg *packages.Package Config *config.Config } func NewInterface( name string, typeSpec *ast.TypeSpec, genDecl *ast.GenDecl, filepath string, fileSyntax *ast.File, pkg *packages.Package, config *config.Config, ) *Interface { return &Interface{ Name: name, TypeSpec: typeSpec, GenDecl: genDecl, FilePath: filepath, FileSyntax: fileSyntax, Pkg: pkg, Config: config, } } ================================================ FILE: internal/logging/logging.go ================================================ package logging import ( "context" "errors" "fmt" "os" "runtime/debug" "strings" "time" "github.com/rs/zerolog" "github.com/vektra/mockery/v3/internal/stackerr" "golang.org/x/term" ) const ( LogKeyBaseDir = "base-dir" LogKeyDir = "dir" LogKeyDocsURL = "docs-url" LogKeyFile = "file" LogKeyInterface = "interface" LogKeyImport = "import" LogKeyPath = "path" LogKeyQualifiedName = "qualified-name" LogKeyPackageName = "package-name" LogKeyPackagePath = "package-path" defaultSemVer = "v0.0.0-dev" ) // SemVer is the version of mockery at build time. var SemVer = "" var ErrPkgNotExist = errors.New("package does not exist") func GetSemverInfo() string { if SemVer != "" { return SemVer } version, ok := debug.ReadBuildInfo() if ok && version.Main.Version != "(devel)" && version.Main.Version != "" { return version.Main.Version } return defaultSemVer } func getMinorSemver(semver string) string { split := strings.Split(semver, ".") return strings.Join(split[0:2], ".") } // GetMinorSemver returns the semantic version up to and including the minor version. func GetMinorSemver() string { return getMinorSemver(GetSemverInfo()) } func DocsURL(relativePath string) string { if string(relativePath[0]) != "/" { relativePath = "/" + relativePath } return fmt.Sprintf("https://vektra.github.io/mockery/%s%s", GetMinorSemver(), relativePath) } type timeHook struct{} func (t timeHook) Run(e *zerolog.Event, level zerolog.Level, msg string) { e.Time("time", time.Now()) } func GetLogger(levelStr string) (zerolog.Logger, error) { level, err := zerolog.ParseLevel(levelStr) if err != nil { return zerolog.Logger{}, stackerr.NewStackErrf(err, "Couldn't parse log level") } out := os.Stderr // This is essentially RFC3339Nano, but we don't truncate trailing zeros so // that the log fields are somewhat aligned. timeFormat := "2006-01-02T15:04:05.000000000Z07:00" writer := zerolog.ConsoleWriter{ Out: out, TimeFormat: timeFormat, } zerolog.TimeFieldFormat = timeFormat if !term.IsTerminal(int(out.Fd())) || os.Getenv("TERM") == "dumb" { //nolint:gosec writer.NoColor = true } log := zerolog.New(writer). Hook(timeHook{}). Level(level). With(). Str("version", GetSemverInfo()). Logger() return log, nil } func Warn(ctx context.Context, prefix string, message string, fields map[string]any) { log := zerolog.Ctx(ctx) event := log.Warn() if fields != nil { event = event.Fields(fields) } event.Msgf("%s: %s", prefix, message) } func Info(ctx context.Context, prefix string, message string, fields map[string]any) { log := zerolog.Ctx(ctx) event := log.Info() if fields != nil { event = event.Fields(fields) } event.Msgf("%s: %s", prefix, message) } func WarnDeprecated(ctx context.Context, message string, fields map[string]any) { Warn(ctx, "DEPRECATION", message, fields) } ================================================ FILE: internal/logging/logging_test.go ================================================ package logging import ( "testing" ) func Test_getMinorSemver(t *testing.T) { tests := []struct { name string arg string want string }{ { name: "default semver", arg: "v0.0.0-dev", want: "v0.0", }, { name: "example semver", arg: "v2.0.1", want: "v2.0", }, { name: "example semver with alpha notation", arg: "v3.0.0-alpha.0", want: "v3.0", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := getMinorSemver(tt.arg); got != tt.want { t.Errorf("getMinorSemver() = %v, want %v", got, tt.want) } }) } } func TestDocsURL(t *testing.T) { tests := []struct { name string arg string want string }{ { name: "url with no leading slash", arg: "features", want: "https://vektra.github.io/mockery/v0.0/features", }, { name: "url with leading slash", arg: "/features", want: "https://vektra.github.io/mockery/v0.0/features", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := DocsURL(tt.arg); got != tt.want { t.Errorf("DocsURL() = %v, want %v", got, tt.want) } }) } } ================================================ FILE: internal/mock_matryer.templ ================================================ {{- if (index .TemplateData "boilerplate-file") }} {{ index .TemplateData "boilerplate-file" | readFile }} {{- end }} // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: matryer {{- if (index .TemplateData "mock-build-tags") }} //go:build {{ index .TemplateData "mock-build-tags" }} {{- end }} package {{.PkgName}} {{- if .Interfaces.ImplementsSomeMethod }} {{- $_ := .Registry.AddImport "sync" "sync" }} {{- end }} {{$srcPkgQualifier := $.SrcPkgQualifier}} {{- if not (index .TemplateData "skip-ensure") }} {{- $_ := $.Registry.AddImport $.Registry.SrcPkgName $.Registry.SrcPkg.PkgPath }} {{- end }} import ( {{- range .Imports}} {{ .ImportStatement }} {{- if eq .Path $.Registry.SrcPkg.PkgPath }} {{- $srcPkgQualifier = (printf "%s." .Qualifier) }} {{- end }} {{- end}} ) {{range $i, $mock := .Interfaces -}} {{- if not (index $mock.TemplateData "skip-ensure") -}} // Ensure that {{.StructName}} does implement {{$srcPkgQualifier}}{{.Name}}. // If this is not the case, regenerate this file with mockery. var _ {{$srcPkgQualifier}}{{.Name -}} {{- if .TypeParams }}[ {{- range $index, $param := .TypeParams}} {{- if $index}}, {{end -}} {{if $param.Constraint}}{{$param.Constraint.String}}{{else}}{{$param.TypeString}}{{end}} {{- end -}} ] {{- end }} = &{{.StructName}} {{- if .TypeParams }}[ {{- range $index, $param := .TypeParams}} {{- if $index}}, {{end -}} {{if $param.Constraint}}{{$param.Constraint.String}}{{else}}{{$param.TypeString}}{{end}} {{- end -}} ] {{- end -}} {} {{- end}} // {{.StructName}} is a mock implementation of {{$srcPkgQualifier}}{{.Name}}. // // func TestSomethingThatUses{{.Name}}(t *testing.T) { // // // make and configure a mocked {{$srcPkgQualifier}}{{.Name}} // mocked{{.Name}} := &{{.StructName}}{ {{- range .Methods}} // {{.Name}}Func: func({{.ArgList}}) {{.ReturnArgTypeList}} { // panic("mock out the {{.Name}} method") // }, {{- end}} // } // // // use mocked{{.Name}} in code that requires {{$srcPkgQualifier}}{{.Name}} // // and then make assertions. // // } type {{.StructName}} {{- if .TypeParams -}} [{{- range $index, $param := .TypeParams}} {{- if $index}}, {{end}}{{$param.Name | exported}} {{$param.TypeString}} {{- end -}}] {{- end }} struct { {{- range .Methods}} // {{.Name}}Func mocks the {{.Name}} method. {{.Name}}Func func({{.ArgList}}) {{.ReturnArgTypeList}} {{end}} // calls tracks calls to the methods. calls struct { {{- range .Methods}} // {{.Name}} holds details about calls to the {{.Name}} method. {{.Name}} []struct { {{- range .Params}} // {{.Name | exported}} is the {{.Name}} argument value. {{.Name | exported}} {{.TypeString}} {{- end}} } {{- end}} } {{- range $i, $method := .Methods}} lock{{ $method.Name }} {{ $.Imports.PkgQualifier "sync" }}.RWMutex {{- end}} } {{range .Methods}} // {{.Name}} calls {{.Name}}Func. func (mock *{{$mock.StructName}}{{ $mock.TypeInstantiation }}) {{.Name}}({{.ArgList}}) {{.ReturnArgTypeList}} { {{- if not (index $mock.TemplateData "stub-impl") }} if mock.{{.Name}}Func == nil { panic("{{$mock.StructName}}.{{.Name}}Func: method is nil but {{$mock.Name}}.{{.Name}} was just called") } {{- end}} callInfo := struct { {{- range .Params}} {{.Name | exported}} {{.TypeString}} {{- end}} }{ {{- range .Params}} {{.Name | exported}}: {{.Name}}, {{- end}} } mock.lock{{.Name}}.Lock() mock.calls.{{.Name}} = append(mock.calls.{{.Name}}, callInfo) mock.lock{{.Name}}.Unlock() {{- if .Returns}} {{- if (index $mock.TemplateData "stub-impl") }} if mock.{{.Name}}Func == nil { var ( {{- range .Returns}} {{.Name}} {{.TypeString}} {{- end}} ) return {{.ReturnArgNameList}} } {{- end}} return mock.{{.Name}}Func({{.ArgCallList}}) {{- else}} {{- if (index $mock.TemplateData "stub-impl") }} if mock.{{.Name}}Func == nil { return } {{- end}} mock.{{.Name}}Func({{.ArgCallList}}) {{- end}} } // {{.Name}}Calls gets all the calls that were made to {{.Name}}. // Check the length with: // // len(mocked{{$mock.Name}}.{{.Name}}Calls()) func (mock *{{$mock.StructName}}{{ $mock.TypeInstantiation }}) {{.Name}}Calls() []struct { {{- range .Params}} {{.Name | exported}} {{.TypeString}} {{- end}} } { var calls []struct { {{- range .Params}} {{.Name | exported}} {{.TypeString}} {{- end}} } mock.lock{{.Name}}.RLock() calls = mock.calls.{{.Name}} mock.lock{{.Name}}.RUnlock() return calls } {{- if index $.TemplateData "with-resets" }} // Reset{{.Name}}Calls reset all the calls that were made to {{.Name}}. func (mock *{{$mock.StructName}}{{ $mock.TypeInstantiation }}) Reset{{.Name}}Calls() { mock.lock{{.Name}}.Lock() mock.calls.{{.Name}} = nil mock.lock{{.Name}}.Unlock() } {{end}} {{end -}} {{- if index $.TemplateData "with-resets" }} // ResetCalls reset all the calls that were made to all mocked methods. func (mock *{{$mock.StructName}}{{ $mock.TypeInstantiation }}) ResetCalls() { {{- range .Methods}} mock.lock{{.Name}}.Lock() mock.calls.{{.Name}} = nil mock.lock{{.Name}}.Unlock() {{end -}} } {{end -}} {{end -}} ================================================ FILE: internal/mock_matryer.templ.schema.json ================================================ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "vektra/mockery matryer mock", "type": "object", "additionalProperties": false, "properties": { "boilerplate-file": { "type": "string" }, "mock-build-tags": { "type": "string" }, "skip-ensure": { "type": "boolean" }, "stub-impl": { "type": "boolean" }, "with-resets": { "type": "boolean" } }, "required": [] } ================================================ FILE: internal/mock_testify.templ ================================================ {{- if (index .TemplateData "boilerplate-file") }} {{ index .TemplateData "boilerplate-file" | readFile }} {{- end }} // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify {{- if (index .TemplateData "mock-build-tags") }} //go:build {{ index .TemplateData "mock-build-tags" }} {{- end }} package {{.PkgName}} import ( {{- range .Imports}} {{ .ImportStatement }} {{- end}} mock "github.com/stretchr/testify/mock" ) {{/* CREATE CONSTRUCTOR */}} {{- range $i, $mock := .Interfaces }} {{/* START MOCK RANGE */}} {{ $new := "New" }} {{ if firstIsLower .StructName }} {{ $new = "new" }} {{- end }} {{- $constructorName := printf "%s%s" $new (.StructName | firstUpper) }} // {{ $constructorName }} creates a new instance of {{ .StructName }}. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func {{ $constructorName }}{{ $mock.TypeConstraint }} (t interface { mock.TestingT Cleanup(func()) }) *{{ .StructName }}{{ $mock.TypeInstantiation }} { mock := &{{ .StructName }}{{ $mock.TypeInstantiation }}{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // {{ .StructName }} is an autogenerated mock type for the {{ .Name }} type type {{ .StructName }}{{ $mock.TypeConstraint }} struct { mock.Mock } type {{.StructName}}_Expecter{{ $mock.TypeConstraint }} struct { mock *mock.Mock } {{- $expecterNameInstantiated := printf "%s_Expecter%s" .StructName ($mock.TypeInstantiation) }} func (_m *{{.StructName}}{{ $mock.TypeInstantiation }}) EXPECT() *{{ $expecterNameInstantiated }} { return &{{ $expecterNameInstantiated }}{mock: &_m.Mock} } {{/* RANGE OVER ALL METHODS */}} {{- range $methodIdx, $method := .Methods }} {{/* START METHOD RANGE */}} // {{ $method.Name }} provides a mock function for the type {{ $mock.StructName }} func (_mock *{{$mock.StructName}}{{ $mock.TypeInstantiation }}) {{$method.Name}}({{$method.ArgList}}) {{$method.ReturnArgTypeList}} { {{- $calledString := "" }} {{- if or (eq (len $method.ArgList) 0) (not $method.IsVariadic) (not (index $mock.TemplateData "unroll-variadic")) }} {{/* START PREAMBLE */}} {{- if and ($method.IsVariadic) (not (index $mock.TemplateData "unroll-variadic")) }} {{- if ne (len $method.Returns) 0}} var tmpRet mock.Arguments {{- $calledString = "tmpRet" }} {{- else }} {{- $calledString = "" }} {{- end }} {{- $lastParam := index $method.Params (len $method.Params | add -1 )}} if len({{ $lastParam.Var.Name }}) > 0 { {{- if ne (len $method.Returns) 0}}tmpRet = {{ end }}_mock.Called({{- if (index $mock.TemplateData "unroll-variadic") }}{{ $method.ArgCallList }}{{- else }}{{ $method.ArgCallListNoEllipsis }}{{- end }}) } else { {{- if ne (len $method.Returns) 0}}tmpRet = {{ end }}_mock.Called({{- if (index $mock.TemplateData "unroll-variadic") }}{{ $method.ArgCallListSlice 0 (len $method.Params | add -1 )}}{{- else }}{{ $method.ArgCallListSliceNoEllipsis 0 (len $method.Params | add -1 )}}{{- end }}) } {{- else }} {{- $calledString = printf "_mock.Called(%s)" $method.ArgCallList }} {{- end }} {{- else }} {{- $lastParam := (index $method.Params (len $method.Params | add -1)) }} {{- $variadicArgsName := $lastParam.Var.Name }} {{- $strippedTypeString := trimPrefix "..." $lastParam.TypeStringEllipsis }} {{- if and (ne $strippedTypeString "interface{}") (ne $strippedTypeString "any") }} // {{ $strippedTypeString }} _va := make([]interface{}, len({{- $lastParam.Var.Name }})) for _i := range {{ $lastParam.Var.Name }} { _va[_i] = {{ $lastParam.Var.Name }}[_i] } {{- $variadicArgsName = "_va" }} {{- end }} var _ca []interface{} {{- if gt (len $method.Params) 1 }} _ca = append(_ca, {{ $method.ArgCallListSlice 0 (len $method.Params | add -1) }}) {{- end }} _ca = append(_ca, {{ $variadicArgsName }}...) {{- $calledString = "_mock.Called(_ca...)" }} {{- end }} {{/* END PREAMBLE */}} {{- if eq (len $method.Returns) 0 }} {{ $calledString }} {{- else }} {{- $retArgs := $method.Scope.AllocateName "ret" }} {{ $retArgs }} := {{ $calledString }} if len({{ $retArgs }}) == 0 { panic("no return value specified for {{$method.Name}}") } {{ range $retIdx, $ret := $method.Returns }} var r{{ $retIdx }} {{ (index $method.Returns $retIdx).TypeString }} {{- end }} {{- if gt (len $method.Returns) 1 }} if returnFunc, ok := {{ $retArgs }}.Get(0).(func{{ $method.SignatureNoName }}); ok { return returnFunc({{ $method.ArgCallList }}) } {{- end }} {{- range $retIdx, $ret := $method.Returns }} {{/* START RETURN RANGE */}} if returnFunc, ok := {{ $retArgs }}.Get({{ $retIdx }}).(func({{$method.ArgTypeListEllipsis }}) {{ (index $method.Returns $retIdx).TypeString }}); ok { r{{ $retIdx }} = returnFunc({{ $method.ArgCallList }}) } else { {{- if eq "error" (index $method.Returns $retIdx).TypeString }} r{{ $retIdx }} = {{ $retArgs }}.Error({{ $retIdx }}) {{- else if (index $method.Returns $retIdx).Var.Nillable }} if {{ $retArgs }}.Get({{ $retIdx }}) != nil { r{{ $retIdx }} = {{ $retArgs }}.Get({{ $retIdx }}).({{ (index $method.Returns $retIdx).TypeString }}) } {{- else }} r{{ $retIdx }} = {{ $retArgs }}.Get({{ $retIdx }}).({{ (index $method.Returns $retIdx).TypeString }}) {{- end }} } {{- end }} {{/* END RETURN RANGE */}} {{- end }} return {{ range $retIdx, $ret := $method.Returns }}r{{ $retIdx }}{{ if ne $retIdx (len $method.Returns | add -1) }}, {{ end }}{{ end }} } {{/* CREATE EXPECTER METHOD */}} {{- $ExpecterCallNameInstantiated := printf "%s_%s_Call%s" $mock.StructName $method.Name ($mock.TypeInstantiation) }} {{- $ExpecterCallNameConstraint := printf "%s_%s_Call%s" $mock.StructName $method.Name ($mock.TypeConstraint) }} // {{ $mock.StructName }}_{{ $method.Name }}_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method '{{ $method.Name }}' type {{ $ExpecterCallNameConstraint }} struct { *mock.Call } // {{ $method.Name }} is a helper method to define mock.On call {{- range $method.Params }} // - {{.Var.Name}} {{.TypeStringEllipsis}} {{- end}} func (_e *{{ $expecterNameInstantiated }}) {{ $method.Name }}({{ range $method.Params }}{{ .Var.Name }} {{ if .Variadic }}...{{end}}interface{}, {{ end }}) *{{ $ExpecterCallNameInstantiated }} { return &{{ $ExpecterCallNameInstantiated }}{Call: _e.mock.On("{{$method.Name}}", {{- if not $method.IsVariadic }} {{- range $method.Params}}{{.Var.Name}},{{end}} {{- else }} append([]interface{}{ {{- range $i, $param := $method.Params }} {{- if (lt $i (len $method.Params | add -1 ))}} {{ $param.Var.Name }}, {{- else }} }, {{ $param.Var.Name }}... {{- end }} {{- end}} )... {{- end }} )} } func (_c *{{ $ExpecterCallNameInstantiated }}) Run(run func({{ $method.ArgList }})) *{{ $ExpecterCallNameInstantiated }} { _c.Call.Run(func(args mock.Arguments) { {{- range $i, $param := $method.Params }} var arg{{ $i }} {{ $param.TypeString }} {{- if and $method.IsVariadic (eq ($i) (len $method.Params | add -1))}} {{- $variadicParam := index $method.Params (len $method.Params | add -1) }} {{- $nonVariadicParams := slice $method.Params 0 (len $method.Params | add -1 )}} {{- if index $mock.TemplateData "unroll-variadic" }} variadicArgs := make([]{{ $variadicParam.TypeStringVariadicUnderlying }}, len(args) - {{len $nonVariadicParams}}) for i, a := range args[{{len $nonVariadicParams}}:] { if a != nil { variadicArgs[i] = a.({{ $variadicParam.TypeStringVariadicUnderlying }}) } } {{- else }} var variadicArgs {{ $variadicParam.TypeString }} if len(args) > {{ len $nonVariadicParams }} { variadicArgs = args[{{ len $nonVariadicParams }}].({{ $variadicParam.TypeString }}) } {{- end }} arg{{ $i }} = variadicArgs {{- else }} if args[{{ $i }}] != nil { arg{{ $i }} = args[{{ $i }}].({{ $param.TypeString }}) } {{- end }} {{- end }} run( {{- range $i, $param := $method.Params }} {{- if and ($method.IsVariadic) (eq $i (len $method.Params | add -1 )) }} arg{{ $i }}..., {{- else }} arg{{ $i }}, {{- end }} {{- end }} ) }) return _c } func (_c *{{ $ExpecterCallNameInstantiated }}) Return({{ $method.ReturnArgList }}) *{{ $ExpecterCallNameInstantiated }} { _c.Call.Return({{ $method.ReturnArgNameList }}) return _c } func (_c *{{ $ExpecterCallNameInstantiated }}) RunAndReturn(run func({{ $method.ArgList }}){{ $method.ReturnArgTypeList }}) *{{ $ExpecterCallNameInstantiated }} { {{- if eq (len $method.Returns) 0 }} _c.Run(run) {{- else}} _c.Call.Return(run) {{- end}} return _c } {{/* END TODO EXPECTER */}} {{- end }} {{/* END METHOD RANGE */}} {{- end }} {{/* END MOCK RANGE */}} ================================================ FILE: internal/mock_testify.templ.schema.json ================================================ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "vektra/mockery testify mock", "type": "object", "additionalProperties": false, "properties": { "boilerplate-file": { "type": "string" }, "mock-build-tags": { "type": "string" }, "unroll-variadic": { "type": "boolean" } }, "required": [] } ================================================ FILE: internal/mockery_test.go ================================================ package internal_test import ( "path/filepath" "runtime" ) var rootPath, testFile, testFile2 string func init() { _, file, _, ok := runtime.Caller(0) if !ok { panic("failed to determine current file path") } rootPath = filepath.Dir(filepath.Dir(file)) testFile = getFixturePath("requester.go") testFile2 = getFixturePath("requester2.go") } // getFixturePath returns an absolute path to a fixture sub-directory or file. // // getFixturePath("src.go") returns "/path/to/pkg/fixtures/src.go" // getFixturePath("a", "b", "c", "src.go") returns "/path/to/pkg/fixtures/a/b/c/src.go" func getFixturePath(subdirOrBasename ...string) string { return filepath.Join(append([]string{rootPath, "pkg", "fixtures"}, subdirOrBasename...)...) } ================================================ FILE: internal/node_visitor.go ================================================ package internal import ( "context" "fmt" "go/ast" "github.com/rs/zerolog" ) type declaredInterface struct { typeSpec *ast.TypeSpec genDecl *ast.GenDecl } type NodeVisitor struct { declaredInterfaces []declaredInterface ctx context.Context lastSeenGenDecl *ast.GenDecl } func NewNodeVisitor(ctx context.Context) *NodeVisitor { return &NodeVisitor{ declaredInterfaces: make([]declaredInterface, 0), ctx: ctx, } } func (nv *NodeVisitor) DeclaredInterfaces() []declaredInterface { return nv.declaredInterfaces } func (nv *NodeVisitor) Visit(node ast.Node) ast.Visitor { log := zerolog.Ctx(nv.ctx) switch n := node.(type) { case *ast.GenDecl: // If the next node in the AST is an *ast.TypeSpec, we can rely on this // being its parent GenDecl because the walk is done depth-first. nv.lastSeenGenDecl = n case *ast.TypeSpec: log := log.With(). Str("node-name", n.Name.Name). Str("node-type", fmt.Sprintf("%T", n.Type)). Logger() switch n.Type.(type) { case *ast.InterfaceType, *ast.IndexExpr, *ast.IndexListExpr, *ast.SelectorExpr, *ast.Ident: log.Debug().Msg("found node with acceptable type for mocking.") nv.declaredInterfaces = append(nv.declaredInterfaces, declaredInterface{ typeSpec: n, genDecl: nv.lastSeenGenDecl, }) default: log.Debug().Msg("found node with unacceptable type for mocking. Rejecting.") } } return nv } ================================================ FILE: internal/parse.go ================================================ package internal import ( "bufio" "context" "errors" "fmt" "go/ast" "go/types" "os" "path/filepath" "regexp" "strings" "github.com/rs/zerolog" "github.com/vektra/mockery/v3/config" "github.com/vektra/mockery/v3/internal/logging" "github.com/vektra/mockery/v3/internal/stackerr" "golang.org/x/tools/go/packages" ) var autoGeneratedRegex = regexp.MustCompile(`^\/\/ Code generated by .* DO NOT EDIT(\.?)( )*$`) type Parser struct { parserPackages []*types.Package conf packages.Config mockeryConfig config.RootConfig } func NewParser(buildTags []string, mockeryConfig config.RootConfig) *Parser { var conf packages.Config conf.Mode = packages.NeedTypes | packages.NeedTypesSizes | packages.NeedSyntax | packages.NeedTypesInfo | packages.NeedImports | packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles if len(buildTags) > 0 { conf.BuildFlags = []string{"-tags", strings.Join(buildTags, ",")} } p := &Parser{ parserPackages: make([]*types.Package, 0), conf: conf, mockeryConfig: mockeryConfig, } return p } func (p *Parser) ParsePackages(ctx context.Context, packageNames []string) ([]*Interface, error) { log := zerolog.Ctx(ctx) interfaces := []*Interface{} packages, err := packages.Load(&p.conf, packageNames...) if err != nil { return nil, err } for _, pkg := range packages { pkgLog := log.With().Str("package", pkg.PkgPath).Logger() pkgCtx := pkgLog.WithContext(ctx) pkgConfig, err := p.mockeryConfig.GetPackageConfig(ctx, pkg.PkgPath) if err != nil { return nil, fmt.Errorf("getting package-level config: %w", err) } if len(pkg.GoFiles) == 0 { continue } for _, err := range pkg.Errors { log.Err(err).Msg("encountered error when loading package") } if len(pkg.Errors) != 0 { return nil, errors.New("error occurred when loading packages") } for fileIdx, filePath := range pkg.GoFiles { filePath = filepath.ToSlash(filePath) fileLog := pkgLog.With().Str("file", filePath).Logger() fileLog.Debug().Msg("found file") if *pkgConfig.Config.IncludeAutoGenerated == false { isGenerated, err := isAutoGenerated(filePath) if err != nil { return nil, fmt.Errorf("determining if file is auto-generated: %w", err) } if isGenerated { fileLog.Debug().Str("docs-url", logging.DocsURL("/include-auto-generated")).Msg("file is auto-generated, skipping.") continue } } fileLog.Debug().Msg("file is not auto-generated.") fileCtx := fileLog.WithContext(pkgCtx) fileSyntax := pkg.Syntax[fileIdx] nv := NewNodeVisitor(fileCtx) ast.Walk(nv, fileSyntax) scope := pkg.Types.Scope() for _, declaredInterface := range nv.declaredInterfaces { ifaceLog := fileLog.With().Str("interface", declaredInterface.typeSpec.Name.Name).Logger() obj := scope.Lookup(declaredInterface.typeSpec.Name.Name) if obj == nil { log.Debug().Str("identifier-name", declaredInterface.typeSpec.Name.Name).Msg("obj was nil") continue } var typ *types.Named var name string ttyp := obj.Type() if talias, ok := obj.Type().(*types.Alias); ok { name = talias.Obj().Name() ttyp = types.Unalias(obj.Type()) } typ, ok := ttyp.(*types.Named) if !ok { ifaceLog.Debug().Msg("interface is not named, skipping") continue } if name == "" { name = typ.Obj().Name() } if typ.Obj().Pkg() == nil { continue } if !types.IsInterface(typ.Underlying()) { ifaceLog.Debug().Msg("type is not an interface, skipping") continue } if isConstraint(declaredInterface.typeSpec, packages) { ifaceLog.Debug().Msg("interface is a constraint, skipping") continue } interfaces = append(interfaces, NewInterface( name, declaredInterface.typeSpec, declaredInterface.genDecl, filePath, fileSyntax, pkg, // Leave the config nil because we don't yet know if // the interface should even be generated in the first // place. nil, )) } } } return interfaces, nil } func isAutoGenerated(pathName string) (bool, error) { file, err := os.Open(pathName) if err != nil { return false, stackerr.NewStackErr(err) } defer file.Close() scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if autoGeneratedRegex.MatchString(text) { return true, nil } else if strings.HasPrefix(text, "package ") { break } } return false, nil } func isConstraint(s *ast.TypeSpec, pkgs []*packages.Package) bool { switch typ := s.Type.(type) { case *ast.Ident: return isConstraintIdent(typ, pkgs) case *ast.SelectorExpr: return isConstraintSelector(typ, pkgs) case *ast.InterfaceType: for _, item := range typ.Methods.List { switch expr := item.Type.(type) { case *ast.UnaryExpr, *ast.BinaryExpr: return true case *ast.SelectorExpr: return isConstraintSelector(expr, pkgs) case *ast.Ident: return isConstraintIdent(expr, pkgs) } } } return false } func isConstraintSelector(sel *ast.SelectorExpr, pkgs []*packages.Package) bool { for _, pkg := range pkgs { if tv, ok := pkg.TypesInfo.Types[sel]; ok { if iface, ok := tv.Type.Underlying().(*types.Interface); ok { return isConstraintInterface(iface) } } } return false } func isConstraintIdent(id *ast.Ident, pkgs []*packages.Package) bool { for _, pkg := range pkgs { if obj := pkg.TypesInfo.Uses[id]; obj != nil { if iface, ok := obj.Type().Underlying().(*types.Interface); ok { return isConstraintInterface(iface) } } } return false } func isConstraintInterface(iface *types.Interface) bool { if iface.NumMethods() > 0 { return false } if iface.NumEmbeddeds() > 0 { return true } return false } ================================================ FILE: internal/remote_template.go ================================================ package internal import ( "context" "fmt" "io" "net/http" "os" "strings" "github.com/rs/zerolog" "github.com/xeipuuv/gojsonschema" ) func httpsGet(ctx context.Context, url string) (string, error) { log := zerolog.Ctx(ctx) //nolint: gosec response, err := http.Get(url) if err != nil { log.Err(err).Msg("failed to download file") return "", fmt.Errorf("downloading file: %w", err) } defer response.Body.Close() body, err := io.ReadAll(response.Body) if err != nil { log.Err(err).Msg("failed to read response body") return "", fmt.Errorf("reading response body: %w", err) } if response.StatusCode != 200 { log.Debug().Int("status-code", response.StatusCode).Msg("got non-200 response when downloading file. Logging response body:") log.Debug().Msg(string(body)) return "", fmt.Errorf("got http code %d: %w", response.StatusCode, errBadHTTPStatus) } return string(body), nil } func download(ctx context.Context, url string) (string, error) { if strings.HasPrefix(url, "file://") { templatePath := strings.SplitAfterN(url, "file://", 2)[1] b, err := os.ReadFile(templatePath) if err != nil { return "", err } return string(b), nil } if strings.HasPrefix(url, "https://") || strings.HasPrefix(url, "http://") { templateString, err := httpsGet(ctx, url) if err != nil { return "", fmt.Errorf("downloading url: %w", err) } return templateString, nil } return "", fmt.Errorf("unsupported protocol specifier in %s", url) } type RemoteTemplate struct { templateURL string templateString string templateDownloaded bool schemaURL string schema *gojsonschema.Schema schemaDownloaded bool requireSchemaExists bool } func NewRemoteTemplate(templateURL string, schemaURL string) *RemoteTemplate { return &RemoteTemplate{ templateURL: templateURL, schemaURL: schemaURL, } } // Template will return the template string. It downloads the remote template once // and caches the result for future calls. func (r *RemoteTemplate) Template(ctx context.Context) (string, error) { var err error if !r.templateDownloaded { r.templateDownloaded = true r.templateString, err = download(ctx, r.templateURL) if err != nil { return "", fmt.Errorf("downloading template: %w", err) } } return r.templateString, nil } // Schema returns the JSON Schema as a string. It downloads the remote schema once // and caches the result for future calls. func (r *RemoteTemplate) Schema(ctx context.Context) (*gojsonschema.Schema, error) { log := zerolog.Ctx(ctx) log.UpdateContext(func(c zerolog.Context) zerolog.Context { return c.Str("remote-template", r.templateURL) }) if !r.schemaDownloaded { log.Debug().Msg("schema not downloaded before") r.schemaDownloaded = true schemaString, err := download(ctx, r.schemaURL) if err != nil { log.Debug().Err(err).Msg("schema download encountered error") return nil, fmt.Errorf("downloading schema: %w", err) } r.schema, err = gojsonschema.NewSchema(gojsonschema.NewStringLoader(schemaString)) if err != nil { return nil, fmt.Errorf("creating JSON schema: %w", err) } } return r.schema, nil } ================================================ FILE: internal/stackerr/stackerr.go ================================================ package stackerr import ( "errors" "fmt" "runtime/debug" ) type StackErr struct { cause error stack []byte } func NewStackErr(cause error) error { return StackErr{ cause: cause, stack: debug.Stack(), } } func NewStackErrf(cause error, f string, args ...any) error { msg := fmt.Sprintf(f, args...) cause = fmt.Errorf(msg+": %w", cause) return NewStackErr(cause) } func (se StackErr) Error() string { return se.cause.Error() } func (se StackErr) Unwrap() error { return se.cause } func (se StackErr) Stack() []byte { return se.stack } func GetStack(err error) ([]byte, bool) { var s interface { Stack() []byte } if errors.As(err, &s) { return s.Stack(), true } return nil, false } ================================================ FILE: internal/stackerr/stackerr_test.go ================================================ package stackerr import ( "fmt" "testing" "github.com/stretchr/testify/assert" ) func TestStackErr(t *testing.T) { err := assert.AnError s, ok := GetStack(err) assert.False(t, ok) assert.Empty(t, s) err = NewStackErr(err) assert.Equal(t, assert.AnError.Error(), err.Error()) s, ok = GetStack(err) assert.True(t, ok) assert.NotEmpty(t, s) err = NewStackErr(fmt.Errorf("wrapped error can still get stack: %w", err)) s, ok = GetStack(err) assert.True(t, ok) assert.NotEmpty(t, s) } func TestStackErrf(t *testing.T) { err := assert.AnError s, ok := GetStack(err) assert.False(t, ok) assert.Empty(t, s) err = NewStackErrf(err, "error message %d %s", 1, "a") assert.Equal(t, "error message 1 a: "+assert.AnError.Error(), err.Error()) s, ok = GetStack(err) assert.True(t, ok) assert.NotEmpty(t, s) } ================================================ FILE: internal/template_generator.go ================================================ package internal import ( "bufio" "bytes" "context" _ "embed" "errors" "fmt" "go/format" "go/token" "go/types" "path/filepath" "strings" "github.com/rs/zerolog" "github.com/vektra/mockery/v3/config" "github.com/vektra/mockery/v3/internal/file" "github.com/vektra/mockery/v3/internal/stackerr" "github.com/vektra/mockery/v3/template" "github.com/xeipuuv/gojsonschema" "golang.org/x/tools/go/packages" "golang.org/x/tools/imports" ) type Formatter string const ( FormatGofmt Formatter = "gofmt" FormatGoImports Formatter = "goimports" FormatNoop Formatter = "noop" ) var ( //go:embed mock_matryer.templ templateMatryer string //go:embed mock_matryer.templ.schema.json templateMatryerJSONSchema string //go:embed mock_testify.templ templateTestify string //go:embed mock_testify.templ.schema.json templateTestifyJSONSchema string ) var errBadHTTPStatus = errors.New("failed to download file") var styleTemplates = map[string]string{ "matryer": templateMatryer, "testify": templateTestify, } var jsonSchemas = map[string]string{ "matryer": templateMatryerJSONSchema, "testify": templateTestifyJSONSchema, } // findPkgPath returns the fully-qualified go import path of a given dir. The // dir must be relative to a go.mod file. In the case it isn't, an error is returned. func findPkgPath(dirPath string) (string, error) { dirPath, err := file.CleanPath(dirPath) if err != nil { return "", stackerr.NewStackErr(err) } goModFile, content, err := file.FindInHierarchy(dirPath, []string{"go.mod"}) if err != nil { return "", stackerr.NewStackErr(err) } dirRelative, err := filepath.Rel(filepath.FromSlash(filepath.Dir(goModFile)), filepath.FromSlash(dirPath)) if err != nil { return "", stackerr.NewStackErr(err) } scanner := bufio.NewScanner(bytes.NewReader(content)) // Iterate over each line for scanner.Scan() { if !strings.HasPrefix(scanner.Text(), "module") { continue } moduleName := strings.Split(scanner.Text(), "module ")[1] return filepath.ToSlash(filepath.Clean(filepath.Join(moduleName, dirRelative))), nil } return "", stackerr.NewStackErr(ErrGoModInvalid) } type TemplateGenerator struct { formatter Formatter inPackage bool requireSchemaExists bool registry *template.Registry templateName string templateSchema string pkgConfig *config.Config pkgName string remoteTemplateCache map[string]*RemoteTemplate } func NewTemplateGenerator( ctx context.Context, srcPkg *packages.Package, outPkgFSPath string, templateName string, templateSchema string, requireSchemaExists bool, remoteTemplateCache map[string]*RemoteTemplate, formatter Formatter, pkgConfig *config.Config, pkgName string, forceInPackage *bool, ) (*TemplateGenerator, error) { log := *zerolog.Ctx(ctx) var err error srcPkgFSPath := filepath.Dir(srcPkg.GoFiles[0]) if !filepath.IsAbs(outPkgFSPath) { outPkgFSPath, err = filepath.Abs(outPkgFSPath) if err != nil { log.Err(err).Msg("failed to make absolute path") return nil, stackerr.NewStackErr(err) } } if !filepath.IsAbs(srcPkgFSPath) { srcPkgFSPath, err = filepath.Abs(srcPkgFSPath) if err != nil { log.Err(err).Msg("failed to make absolute path") return nil, stackerr.NewStackErr(err) } } srcPkgFSPath = filepath.ToSlash(filepath.Clean(srcPkgFSPath)) outPkgFSPath = filepath.ToSlash(filepath.Clean(outPkgFSPath)) newLogger := zerolog.Ctx(ctx).With(). Str("srcPkgFSPath", srcPkgFSPath). Str("outPkgFSPath", outPkgFSPath). Str("src-pkg-name", srcPkg.Name). Str("out-pkg-name", pkgName). Logger() log = newLogger outPkgPath, err := findPkgPath(outPkgFSPath) if err != nil { log.Err(err).Msg("failed to find output package path") return nil, err } log = log.With().Str("outPkgPath", outPkgPath).Logger() var inPackage bool if forceInPackage != nil { log.Debug().Bool("inpackage", *forceInPackage).Msg("inpackage value provided, forcing to value") inPackage = *forceInPackage } else { // Note: Technically, go allows test files to have a different package name // than non-test files. In this case, the test files have to import the source // package just as if it were in a different directory. if pkgName == srcPkg.Name && srcPkgFSPath == outPkgFSPath { log.Debug().Msg("output package detected to be in-package of original package") inPackage = true } else { log.Debug().Msg("output package detected to not be in-package of original package") } } reg, err := template.NewRegistry(srcPkg, outPkgPath, inPackage) if err != nil { return nil, fmt.Errorf("creating new registry: %w", err) } return &TemplateGenerator{ templateName: templateName, templateSchema: templateSchema, requireSchemaExists: requireSchemaExists, registry: reg, formatter: formatter, inPackage: inPackage, pkgConfig: pkgConfig, pkgName: pkgName, remoteTemplateCache: remoteTemplateCache, }, nil } func (g *TemplateGenerator) format(src []byte) ([]byte, error) { switch g.formatter { case FormatGoImports: return goimports(src, g.pkgConfig.FormatterOptions.GoImports) case FormatGofmt: return gofmt(src) case FormatNoop: return src, nil } return nil, fmt.Errorf("unknown formatter type: %s", g.formatter) } func getTypePath(t types.Type) (paramPkgPath string, paramObjName string) { switch t := t.(type) { case *types.Named: pkg := t.Obj().Pkg() if pkg != nil { paramPkgPath = pkg.Path() } paramObjName = t.Obj().Name() case *types.Alias: pkg := t.Obj().Pkg() if pkg != nil { paramPkgPath = pkg.Path() } paramObjName = t.Obj().Name() case *types.Pointer: paramPkgPath, paramObjName = getTypePath(t.Elem()) } return paramPkgPath, paramObjName } func (g *TemplateGenerator) methodData(ctx context.Context, method *types.Func, ifaceConfig *config.Config) (template.Method, error) { log := zerolog.Ctx(ctx) methodScope := g.registry.MethodScope() signature := method.Type().(*types.Signature) params := make([]template.Param, signature.Params().Len()) for j := 0; j < signature.Params().Len(); j++ { param := signature.Params().At(j) log.Debug().Str("param-string", param.String()).Msg("found parameter") for _, imprt := range g.registry.Imports() { log.Debug().Str("import", imprt.Path()).Str("import-qualifier", imprt.Qualifier()).Msg("existing imports") } paramPkgPath, paramObjName := getTypePath(param.Type()) replacement := ifaceConfig.GetReplacement(paramPkgPath, paramObjName) if replacement != nil { log.Debug().Str("replace-to-pkg-path", replacement.PkgPath).Str("replace-to-type-name", replacement.TypeName).Msg("found replacement") } else { log.Debug().Str("param-pkg-path", paramPkgPath).Msg("replacement not found") } v, err := methodScope.AddVar(ctx, param, "", replacement) if err != nil { return template.Method{}, err } params[j] = template.Param{ Var: v, Variadic: signature.Variadic() && j == signature.Params().Len()-1, } } returns := make([]template.Param, signature.Results().Len()) for j := 0; j < signature.Results().Len(); j++ { param := signature.Results().At(j) paramLog := log.With().Str("param-string", param.String()).Logger() paramCtx := paramLog.WithContext(ctx) paramLog.Debug().Msg("found return") paramPkgPath, paramObjName := getTypePath(param.Type()) replacement := ifaceConfig.GetReplacement(paramPkgPath, paramObjName) if replacement != nil { log.Debug().Str("replace-to-pkg-path", replacement.PkgPath).Str("replace-to-type-name", replacement.TypeName).Msg("found replacement") } else { log.Debug().Str("param-pkg-path", paramPkgPath).Msg("replacement not found") } v, err := methodScope.AddVar(paramCtx, param, "", replacement) if err != nil { return template.Method{}, err } returns[j] = template.Param{ Var: v, Variadic: false, } } return template.Method{ Name: method.Name(), Params: params, Returns: returns, Scope: methodScope, }, nil } func explicitConstraintType(typeParam *types.Var) (t types.Type) { underlying := typeParam.Type().Underlying().(*types.Interface) // check if any of the embedded types is either a basic type or a union, // because the generic type has to be an alias for one of those types then for j := 0; j < underlying.NumEmbeddeds(); j++ { t := underlying.EmbeddedType(j) switch t := t.(type) { case *types.Basic: return t case *types.Union: // only unions of basic types are allowed, so just take the first one as a valid type constraint return t.Term(0).Type() } } return nil } func (g *TemplateGenerator) typeParams(ctx context.Context, tparams *types.TypeParamList) ([]template.TypeParam, error) { var tpd []template.TypeParam if tparams == nil { return tpd, nil } tpd = make([]template.TypeParam, tparams.Len()) scope := g.registry.MethodScope() for i := 0; i < len(tpd); i++ { tp := tparams.At(i) typeParam := types.NewParam(token.Pos(i), tp.Obj().Pkg(), tp.Obj().Name(), tp.Constraint()) v, err := scope.AddVar(ctx, typeParam, "", nil) if err != nil { return nil, err } tpd[i] = template.TypeParam{ Param: template.Param{Var: v}, Constraint: explicitConstraintType(typeParam), } } return tpd, nil } // getTemplate returns the requested template and associated schema (if available). func (g *TemplateGenerator) getTemplate(ctx context.Context) (string, *gojsonschema.Schema, error) { log := zerolog.Ctx(ctx).With().Str("template", g.templateName).Str("schema", g.templateSchema).Logger() ctx = log.WithContext(ctx) for _, protocol := range []string{"file://", "https://", "http://"} { var schema *gojsonschema.Schema var err error if !strings.HasPrefix(g.templateName, protocol) { continue } var remoteTemplate *RemoteTemplate if cachedRemoteTemplate, ok := g.remoteTemplateCache[g.templateName]; !ok { remoteTemplate = NewRemoteTemplate(g.templateName, g.templateSchema) g.remoteTemplateCache[g.templateName] = remoteTemplate } else { remoteTemplate = cachedRemoteTemplate } templateString, err := remoteTemplate.Template(ctx) if err != nil { log.Error().Msg("could not download template") return "", nil, fmt.Errorf("downloading template: %w", err) } if g.requireSchemaExists { schema, err = remoteTemplate.Schema(ctx) if err != nil { log.Error().Msg("could not get JSON schema") return "", nil, fmt.Errorf("downloading schema: %w", err) } } return templateString, schema, nil } // Embedded templates var styleExists bool templateString, styleExists := styleTemplates[g.templateName] if !styleExists { return "", nil, fmt.Errorf("template '%s' does not exist", g.templateName) } schema, err := gojsonschema.NewSchema(gojsonschema.NewStringLoader(jsonSchemas[g.templateName])) if err != nil { return "", nil, fmt.Errorf("generating schema: %w", err) } return templateString, schema, nil } func validateSchema(ctx context.Context, data template.Data, schema *gojsonschema.Schema) error { if schema == nil { return errors.New("jschema argument can't be nil") } if err := data.TemplateData.VerifyJSONSchema(ctx, schema); err != nil { return fmt.Errorf("validating template-data") } for _, intf := range data.Interfaces { if err := intf.TemplateData.VerifyJSONSchema(ctx, schema); err != nil { return fmt.Errorf("verifying template-data for %s: %w", intf.Name, err) } } return nil } func (g *TemplateGenerator) Generate( ctx context.Context, interfaces []*Interface, ) ([]byte, error) { log := zerolog.Ctx(ctx) log.UpdateContext(func(c zerolog.Context) zerolog.Context { return c.Str("template", g.templateName).Str("schema", g.templateSchema) }) mockData := []template.Interface{} for _, ifaceMock := range interfaces { ifaceLog := log.With(). Str("interface-name", ifaceMock.Name). Str("package-path", ifaceMock.Pkg.PkgPath). Str("mock-name", *ifaceMock.Config.StructName). Logger() ctx := ifaceLog.WithContext(ctx) ifaceLog.Debug().Msg("looking up interface in registry") iface, tparams, err := g.registry.LookupInterface(ifaceMock.Name) if err != nil { log.Err(err).Msg("error looking up interface") return []byte{}, err } ifaceLog.Debug().Msg("found interface") methods := make([]template.Method, iface.NumMethods()) for i := 0; i < iface.NumMethods(); i++ { methodData, err := g.methodData(ctx, iface.Method(i), ifaceMock.Config) if err != nil { return nil, err } methods[i] = methodData } // Now that all methods have been generated, we need to resolve naming // conflicts that arise between variable names and package qualifiers. for _, method := range methods { method.Scope.ResolveVariableNameCollisions( zerolog. Ctx(ctx). With(). Str("method-name", method.Name). Logger(). WithContext(ctx)) } ifaceLog.Debug().Str("template-data", fmt.Sprintf("%v", ifaceMock.Config.TemplateData)).Msg("printing template data") tParams, err := g.typeParams(ctx, tparams) if err != nil { return nil, err } mockData = append(mockData, template.NewInterface( ifaceMock.Name, *ifaceMock.Config.StructName, tParams, methods, ifaceMock.Config.TemplateData, template.NewComments(ifaceMock.TypeSpec, ifaceMock.GenDecl), )) } data := template.NewData( g.pkgName, "", template.Packages{}, mockData, g.pkgConfig.TemplateData, g.registry, ) if !g.inPackage { data.SrcPkgQualifier = g.registry.SrcPkgName() + "." } templateString, schema, err := g.getTemplate(ctx) if err != nil { log.Error().Msg("could not get template") return nil, fmt.Errorf("getting template: %w", err) } if schema != nil { if err := validateSchema(ctx, data, schema); err != nil { log.Error().Msg("failed to validate schema") return nil, fmt.Errorf("validating schema: %w", err) } } templ, err := template.New(templateString, g.templateName) if err != nil { return []byte{}, fmt.Errorf("creating new template: %w", err) } var buf bytes.Buffer log.Debug().Msg("executing template") if err := templ.Execute(&buf, data); err != nil { log.Error().Msg("failed to execute template") return []byte{}, fmt.Errorf("executing template: %w", err) } log.Debug().Msg("formatting file in-memory") formatted, err := g.format(buf.Bytes()) if err != nil { scanner := bufio.NewScanner(strings.NewReader(buf.String())) for i := 1; scanner.Scan(); i++ { fmt.Printf("%d:\t%s\n", i, scanner.Text()) } log.Err(err).Msg("can't format mock file in-memory") return []byte{}, fmt.Errorf("formatting mock file: %w", err) } return formatted, nil } func goimports(src []byte, opts *config.GoImports) ([]byte, error) { var localPrefix string var importsOpts *imports.Options if opts != nil { localPrefix = opts.GetLocalPrefix() importsOpts = opts.Options() } imports.LocalPrefix = localPrefix formatted, err := imports.Process("/", src, importsOpts) if err != nil { return nil, fmt.Errorf("goimports: %s", err) } return formatted, nil } func gofmt(src []byte) ([]byte, error) { formatted, err := format.Source(src) if err != nil { return nil, fmt.Errorf("go/format: %s", err) } return formatted, nil } ================================================ FILE: internal/template_generator_test.go ================================================ package internal import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestFindPkgPath(t *testing.T) { pkgPath, err := findPkgPath("./fixtures") require.NoError(t, err) assert.NotEqual(t, "", pkgPath) } ================================================ FILE: main.go ================================================ package main import ( "github.com/vektra/mockery/v3/internal/cmd" ) func main() { cmd.Execute() } ================================================ FILE: mkdocs.yml ================================================ site_name: mockery site_url: https://vektra.github.io/mockery/ site_description: >- Create mock implementations of your Golang interfaces using mockery and testify. repo_name: vektra/mockery repo_url: https://github.com/vektra/mockery edit_uri: edit/v3/docs theme: name: material icon: logo: fontawesome/brands/golang palette: # Palette toggle for light mode - media: "(prefers-color-scheme: light)" scheme: default primary: green toggle: icon: material/brightness-7 name: Switch to dark mode # Palette toggle for dark mode - media: "(prefers-color-scheme: dark)" scheme: slate primary: green toggle: icon: material/brightness-4 name: Switch to light mode features: - content.action.edit - content.action.view - content.code.annotate - content.code.copy - content.footnote.tooltips - navigation.indexes - navigation.path - navigation.sections - navigation.tracking - toc.follow markdown_extensions: - admonition - attr_list - footnotes - md_in_html - pymdownx.emoji: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.details - pymdownx.highlight: anchor_linenums: true auto_title: true - pymdownx.inlinehilite - pymdownx.magiclink - pymdownx.snippets - pymdownx.superfences - pymdownx.tabbed: alternate_style: true - toc: permalink: true nav: - Home: index.md - Getting Started: - Installation: installation.md - Configuration: configuration.md - Templates: - template/index.md - template/testify.md - template/matryer.md - Features: - include-auto-generated.md - inpackage.md - replace-type.md - generate-directive.md - Notes: - faq.md - v3.md - dev-notes.md extra_css: - stylesheets/extra.css extra_javascript: - https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js - javascripts/tablesort.js extra: version: provider: mike analytics: provider: google property: G-0ZGMQGZGRN plugins: - glightbox - mike: alias_type: symlink canonical_version: null - open-in-new-tab - search - social - typeset: enabled: true ================================================ FILE: mockery-tools.env ================================================ VERSION=v3.7.0 ================================================ FILE: mocks_testify_main_test.go ================================================ // TEST MOCKERY BOILERPLATE // Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package main import ( mock "github.com/stretchr/testify/mock" ) // newMockfoo creates a new instance of mockfoo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockfoo(t interface { mock.TestingT Cleanup(func()) }) *mockfoo { mock := &mockfoo{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // mockfoo is an autogenerated mock type for the foo type type mockfoo struct { mock.Mock } type mockfoo_Expecter struct { mock *mock.Mock } func (_m *mockfoo) EXPECT() *mockfoo_Expecter { return &mockfoo_Expecter{mock: &_m.Mock} } // Bar provides a mock function for the type mockfoo func (_mock *mockfoo) Bar() baz { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Bar") } var r0 baz if returnFunc, ok := ret.Get(0).(func() baz); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(baz) } return r0 } // mockfoo_Bar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bar' type mockfoo_Bar_Call struct { *mock.Call } // Bar is a helper method to define mock.On call func (_e *mockfoo_Expecter) Bar() *mockfoo_Bar_Call { return &mockfoo_Bar_Call{Call: _e.mock.On("Bar")} } func (_c *mockfoo_Bar_Call) Run(run func()) *mockfoo_Bar_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *mockfoo_Bar_Call) Return(bazMoqParam baz) *mockfoo_Bar_Call { _c.Call.Return(bazMoqParam) return _c } func (_c *mockfoo_Bar_Call) RunAndReturn(run func() baz) *mockfoo_Bar_Call { _c.Call.Return(run) return _c } ================================================ FILE: template/README.md ================================================ Template -------- This package contains all of the data passed to mockery templates. The top-most variable provided to the templates is [Data](https://pkg.go.dev/github.com/vektra/mockery/v3/template#Data). Attributes of this struct can be accessed using syntax like: ``` package {{.PkgName}} import ( {{- range .Imports}} {{. | importStatement}} {{- end}} mock "github.com/stretchr/testify/mock" ) ``` Further examples of how to use the data provided to mockery templates can be found in the pre-curated mocks, such as: - [matryer](https://github.com/vektra/mockery/blob/v3/internal/mock_matryer.templ) - [testify](https://github.com/vektra/mockery/blob/v3/internal/mock_testify.templ) Full documentation is provided at: https://vektra.github.io/mockery/v3/ ================================================ FILE: template/comment_group.go ================================================ package template import "go/ast" // Comment represents a single line of comments exactly as it appears in source. // This includes the "//" or "/*" strings if present. type Comment string type CommentGroup struct { // List contains each individual line of the comments exactly as they appear // in source, including comment characters. List []Comment // Text contains the text of the comments without comment characters. Text string } func NewCommentGroupFromAST(comments *ast.CommentGroup) CommentGroup { group := CommentGroup{ List: []Comment{}, Text: "", } if comments == nil { return group } group.Text = comments.Text() for _, line := range comments.List { group.List = append(group.List, Comment(line.Text)) } return group } ================================================ FILE: template/comments.go ================================================ package template import "go/ast" type Comments struct { /* GenDeclDoc represents the doc comments for a general declaration. For example, if you were to define an interface with the following comments: // Foo defines Bar type Foo interface { Bar() string } then GenDeclDoc will contain the "// Foo defines Bar" comment. Similarly, if you define your interface like: // hello world type ( // Foo defines Bar Foo interface { Bar() string } ) then GenDeclDoc will contain the "// hello world" comment. */ GenDeclDoc CommentGroup /* TypeSpecComment contains in-line comments for a type spec. For example: type Foo interface { Bar() string } // This is a line comment */ TypeSpecComment CommentGroup /* TypeSpecDoc contains the docs for a type spec. For example: type ( // Foo defines Bar Foo interface { Bar() string } ) TypeSpecDoc will _not_ contain the comments defined like this: // Foo defines Bar type Foo interface { Bar() string } The reason is because the Go AST defines this as a comment on an *ast.GenDecl, not an *ast.TypeSpec. */ TypeSpecDoc CommentGroup } func NewComments(typeSpec *ast.TypeSpec, genDecl *ast.GenDecl) Comments { return Comments{ GenDeclDoc: NewCommentGroupFromAST(genDecl.Doc), TypeSpecComment: NewCommentGroupFromAST(typeSpec.Comment), TypeSpecDoc: NewCommentGroupFromAST(typeSpec.Doc), } } ================================================ FILE: template/data.go ================================================ package template // Data is the template data used to render the mock template. type Data struct { // PkgName is the name of the package chosen for the template. PkgName string // Registry chiefly maintains the list of imports that are required in the // rendered template file. Registry *Registry // SrcPkgQualifier is the qualifier used for the source package, if any. // For example, if the source package is different from the package the template // is rendered into, this string will contain something like "foo.", where // "foo" is the alias or package name of the source package. SrcPkgQualifier string // Interfaces is the list of interfaces being rendered in the template. Interfaces Interfaces // TemplateData is a schemaless map containing parameters from configuration // you may consume in your template. TemplateData TemplateData } func (d Data) Imports() Packages { return d.Registry.Imports() } func NewData( pkgName string, srcPkgQualifier string, imports Packages, interfaces Interfaces, templateData TemplateData, registry *Registry, ) Data { return Data{ Interfaces: interfaces, PkgName: pkgName, Registry: registry, TemplateData: templateData, SrcPkgQualifier: srcPkgQualifier, } } ================================================ FILE: template/interface.go ================================================ package template // Interface is the data used to generate a mock for some interface. type Interface struct { Comments Comments Methods []Method // Name is the name of the original interface. Name string // StructName is the chosen name for the struct that will implement the interface. StructName string TemplateData TemplateData TypeParams []TypeParam } func NewInterface( name string, structName string, typeParams []TypeParam, methods []Method, templateData TemplateData, comments Comments, ) Interface { return Interface{ Name: name, StructName: structName, TypeParams: typeParams, Methods: methods, TemplateData: templateData, Comments: comments, } } func (m Interface) TypeConstraintTest() string { if len(m.TypeParams) == 0 { return "" } s := "[" for idx, param := range m.TypeParams { if idx != 0 { s += ", " } s += param.Name() s += " " s += param.TypeString() } s += "]" return s } func (m Interface) TypeConstraint() string { if len(m.TypeParams) == 0 { return "" } s := "[" for idx, param := range m.TypeParams { if idx != 0 { s += ", " } s += param.Name() s += " " s += param.TypeString() } s += "]" return s } func (m Interface) TypeInstantiation() string { if len(m.TypeParams) == 0 { return "" } s := "[" for idx, param := range m.TypeParams { if idx != 0 { s += ", " } s += param.Name() } s += "]" return s } ================================================ FILE: template/interfaces.go ================================================ package template type Interfaces []Interface // ImplementsSomeMethod returns true if any one of the Mocks has at least 1 method. func (m Interfaces) ImplementsSomeMethod() bool { for _, mock := range m { if len(mock.Methods) > 0 { return true } } return false } ================================================ FILE: template/method.go ================================================ package template import ( "fmt" "strings" ) // Method is the data which represents a method on some interface. type Method struct { // Name is the method's name. Name string // Params represents all the arguments to the method. Params []Param // Returns represents all the return parameters of the method. Returns []Param // Scope represents the lexical scope of the method. Its primary function // is keeping track of all names visible in the current scope, which allows // the creation of new variables with guaranteed non-conflicting names. Scope *MethodScope } // ReturnStatement returns the string "return" if a method has return values. // Otherwise, it returns an empty string. func (m Method) ReturnStatement() string { if len(m.Returns) > 0 { return "return" } return "" } // Call returns a string containing the method call. This will usually need to be // prefixed with a selector to specify which actual method to call. For example, // if the method has a signature of "func Foo(s string) error", this method will // return the string "Foo(s)". The name of each argument variable will be the same // as what was generated post collision-resolution. Meaning, the argument variable // name might be slightly altered from the original function if a naming collision // was found. func (m Method) Call() string { return fmt.Sprintf("%s(%s)", m.Name, m.ArgCallList()) } // AcceptsContext returns whether or not the first argument of the method is a context.Context. func (m Method) AcceptsContext() bool { if len(m.Params) > 0 && m.Params[0].TypeString() == "context.Context" { return true } return false } func (m Method) signature(includeNames bool) string { return fmt.Sprintf("(%s) (%s)", m.argList(includeNames), m.returnArgList(includeNames)) } // Signature returns the string representation of the method's signature. For example, // if a method was declared as "func (b Bar) Foo(s string) error", this method will // return "(s string) error" func (m Method) Signature() string { return m.signature(true) } // SignatureNoName is the same as Signature except the argument and return parameter // names are not included. func (m Method) SignatureNoName() string { return m.signature(false) } // Declaration returns the method name followed by its signature. For // example, if a method was declared as "func (b Bar) Foo(s string) error", this method // will return "Foo(s string) error" func (m Method) Declaration() string { return m.Name + m.Signature() } func (m Method) ReturnsError() bool { // Yes I know that by convention the last return value is the error, // but to be technically correct, we have to check all return values. for _, ret := range m.Returns { if ret.Var.TypeString() == "error" { return true } } return false } func (m Method) HasParams() bool { return len(m.Params) > 0 } func (m Method) HasReturns() bool { return len(m.Returns) > 0 } func (m Method) argList(includeName bool) string { params := make([]string, len(m.Params)) for i, p := range m.Params { if includeName { params[i] = p.MethodArg() } else { params[i] = p.MethodArgNoName() } } return strings.Join(params, ", ") } // ArgList is the string representation of method parameters, ex: // 's string, n int, foo bar.Baz'. func (m Method) ArgList() string { return m.argList(true) } // ArgListNoName is the same as ArgList except the argument names are not included. func (m Method) ArgListNoName() string { return m.argList(false) } // ArgTypeList returns the argument types in a comma-separated string, ex: // `string, int, bar.Baz` func (m Method) ArgTypeList() string { params := make([]string, len(m.Params)) for i, p := range m.Params { params[i] = p.TypeString() } return strings.Join(params, ", ") } // ArgTypeListEllipsis returns the argument types in a comma-separated string, ex: // `string, int, bar.Baz`. If the last argument is variadic, it will contain an // ellipsis as would be expected in a variadic function definition. func (m Method) ArgTypeListEllipsis() string { params := make([]string, len(m.Params)) for i, p := range m.Params { params[i] = p.TypeStringEllipsis() } return strings.Join(params, ", ") } // ArgCallList is the string representation of method call parameters, // ex: 's, n, foo'. In case of a last variadic parameter, it will be of // the format 's, n, foos...'. func (m Method) ArgCallList() string { return m.argCallListSlice(0, -1, true) } // ArgCallListNoEllipsis is the same as ArgCallList, except the last parameter, if // variadic, will not contain an ellipsis. func (m Method) ArgCallListNoEllipsis() string { return m.argCallListSlice(0, -1, false) } // argCallListSlice is similar to ArgCallList, but it allows specification of // a slice range to use for the parameter lists. Specifying an integer less than // 1 for end indicates to slice to the end of the parameters. As with regular // Go slicing semantics, the end value is a non-inclusive index. func (m Method) ArgCallListSlice(start, end int) string { return m.argCallListSlice(start, end, true) } func (m Method) ArgCallListSliceNoEllipsis(start, end int) string { return m.argCallListSlice(start, end, false) } func (m Method) argCallListSlice(start, end int, ellipsis bool) string { if end < 0 { end = len(m.Params) } if end == 1 && len(m.Params) == 0 { end = 0 } paramsSlice := m.Params[start:end] params := make([]string, len(paramsSlice)) for i, p := range paramsSlice { params[i] = p.CallName(ellipsis) } return strings.Join(params, ", ") } // ReturnArgTypeList is the string representation of method return // types, ex: 'bar.Baz', '(string, error)'. func (m Method) ReturnArgTypeList() string { params := make([]string, len(m.Returns)) for i, p := range m.Returns { params[i] = p.TypeString() } if len(m.Returns) > 1 { return fmt.Sprintf("(%s)", strings.Join(params, ", ")) } return strings.Join(params, ", ") } // ReturnArgNameList is the string representation of values being // returned from the method, ex: 'foo', 's, err'. func (m Method) ReturnArgNameList() string { params := make([]string, len(m.Returns)) for i, p := range m.Returns { params[i] = p.Name() } return strings.Join(params, ", ") } func (m Method) returnArgList(includeNames bool) string { params := make([]string, len(m.Returns)) for i, p := range m.Returns { if includeNames { params[i] = p.Name() + " " } params[i] += p.TypeString() } return strings.Join(params, ", ") } // ReturnArgList returns the name and types of the return values. For example: // "foo int, bar string, err error" func (m Method) ReturnArgList() string { return m.returnArgList(true) } // ReturnArgListNoName is the same as ReturnArgList except the return argument // names are not included. func (m Method) ReturnArgListNoName() string { return m.returnArgList(false) } func (m Method) IsVariadic() bool { return len(m.Params) > 0 && m.Params[len(m.Params)-1].Variadic } ================================================ FILE: template/method_scope.go ================================================ package template import ( "context" "fmt" "go/types" "github.com/rs/zerolog" "github.com/vektra/mockery/v3/config" "github.com/vektra/mockery/v3/internal/stackerr" "golang.org/x/tools/go/packages" ) // MethodScope is the sub-registry for allocating variables present in // the method scope. // // It should be created using a registry instance. type MethodScope struct { // registry is a pointer to the file-global registry that contains a list // of all imports. registry *Registry pkgPath string vars []*Var conflicted map[string]bool // visibleNames contains a collection of all names visible to this lexical // scope. This includes import qualifiers, type names etc. This is used to prevent naming // collisions. visibleNames map[string]any } func NewMethodScope(r *Registry) *MethodScope { m := &MethodScope{ registry: r, vars: []*Var{}, conflicted: map[string]bool{}, visibleNames: map[string]any{}, } for key := range r.importQualifiers { m.AddName(key) } return m } // ResolveVariableNameCollisions modifies argument names if they are found to // collide with any other names visible to the scope. // // This method is not meant to be used directly by templates. func (m *MethodScope) ResolveVariableNameCollisions(ctx context.Context) { log := zerolog.Ctx(ctx) for _, v := range m.vars { varLog := log.With().Str("variable-name", v.Name).Logger() newName := m.SuggestName(v.Name) if newName != v.Name { varLog.Debug().Str("new-name", newName).Msg("variable was found to conflict with previously allocated name. Giving new name.") } v.Name = newName m.AddName(v.Name) } } // SuggestName creates a new variable name in the lexical scope of the method. // It ensures the returned name does not conflict with any other name visible // to the scope. This method does _not_ register the returned name suggestion // in the scope, which must separately be done by `MethodScope.AddName`. func (m *MethodScope) SuggestName(prefix string) string { var suggestion string for i := 0; ; i++ { if i == 0 { suggestion = prefix } else { suggestion = fmt.Sprintf("%s%d", prefix, i) } if !m.NameExists(suggestion) { break } } return suggestion } // AllocateName creates a new variable name in the lexical scope of the method. // The name is guaranteed to not collide with any other existing names at the time // of the call. It automatically allocates the name to the current scope. Returned // is the name post collision resolution. func (m *MethodScope) AllocateName(prefix string) string { suggestion := m.SuggestName(prefix) m.AddName(suggestion) return suggestion } // fakePackage is used during type replacements (the replace-type parameter). // We don't want to call `packages.Load` in order to obtain a real `*packages.Package` // object, so we instead can create a mock implementation and provide the necessary // values (obtained from `replace-type`). type fakePackage struct { name string path string } func (f fakePackage) Name() string { return f.name } func (f fakePackage) Path() string { return f.path } var _ TypesPackage = fakePackage{} // AddVar allocates a variable instance and adds it to the method scope. // // Variables names are generated if required and are ensured to be // without conflict with other variables and imported packages. It also // adds the relevant imports to the registry for each added variable. // // This method is not meant to be used directly by templates. func (m *MethodScope) AddVar(ctx context.Context, vr *types.Var, prefix string, replacement *config.ReplaceType) (*Var, error) { var ( imports map[string]*Package = map[string]*Package{} v Var ) log := zerolog.Ctx(ctx) if replacement != nil { newLogger := log.With(). Str("replace-pkg-path", replacement.PkgPath). Str("replace-type-name", replacement.TypeName).Logger() log = &newLogger ctx = log.WithContext(ctx) log.Debug().Msg("working with replacement") // Type replacements are really tricky. Mockery needs to correctly // gather type information from the package specified in the replacement. // This basically means that we need to call packages.Load to satisfy this requirement, // then find the type name in the replacement. // // NOTE: This section WILL be slow, because `packages.Load` is slow. Future // enhancement will be to find a way to either cache these calls, batch // them together for all replace-type instances, or find a way to avoid // this altogether. var conf packages.Config conf.Mode = packages.NeedTypes | packages.NeedTypesSizes | packages.NeedSyntax | packages.NeedTypesInfo | packages.NeedImports | packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles pkgs, err := packages.Load(&conf, replacement.PkgPath) if err != nil { log.Err(err).Msg("couldn't load package") return nil, stackerr.NewStackErr(err) } var object types.Object var objectPkg *packages.Package for _, pkg := range pkgs { object = pkg.Types.Scope().Lookup(replacement.TypeName) if object != nil { objectPkg = pkg break } } if object == nil { log.Error().Msg("type-name was not found in the referenced package") return nil, stackerr.NewStackErr(fmt.Errorf("type does not exist in referenced package")) } m.addImport( ctx, objectPkg.Types, imports, ) // Check to see if the original type is a pointer. If so, the replacement type // should also be a pointer. At some point we may want to provide configuration // overrides for this behavior, but this auto-detection should be good enough // for now. objectType := object.Type() switch vr.Type().(type) { case *types.Pointer: objectType = types.NewPointer(objectType) } v = Var{ vr: vr, typ: objectType, imports: imports, pkgPath: m.pkgPath, } } else { imports = m.populateImports(ctx, vr.Type()) v = Var{ vr: vr, typ: vr.Type(), imports: imports, pkgPath: m.pkgPath, } m.AddName(v.TypeString()) } v.Name = m.SuggestName(varName(vr, prefix)) m.vars = append(m.vars, &v) return &v, nil } // AddName records name as visible in the current scope. This method does not check // for naming collisions, and consequently will not modify the given name in any // way. It's recommended that you first check MethodScope.NameExists to determine // if the name has any collisions, or use MethodScope.AllocateName. func (m *MethodScope) AddName(name string) { m.visibleNames[name] = nil } // NameExists returns whether or not the name is currently visible in the scope. func (m *MethodScope) NameExists(name string) bool { _, exists := m.visibleNames[name] return exists } func (m *MethodScope) addImport(ctx context.Context, pkg TypesPackage, imports map[string]*Package) { imprt := m.registry.addImport(ctx, pkg) imports[pkg.Path()] = imprt m.AddName(imprt.Qualifier()) } func (m *MethodScope) populateImportNamedType( ctx context.Context, t interface { Obj() *types.TypeName TypeArgs() *types.TypeList }, imports map[string]*Package, ) { log := zerolog.Ctx(ctx) if pkg := t.Obj().Pkg(); pkg != nil { log.Debug().Str("method", "populateImportNamedType").Str("pkg-path", pkg.Path()).Msg("adding import from var") m.addImport(ctx, pkg, imports) } // The imports of a Type with a TypeList must be added to the imports list // For example: Foo[otherpackage.Bar] , must have otherpackage imported if targs := t.TypeArgs(); targs != nil { for i := 0; i < targs.Len(); i++ { m.populateImportsHelper(ctx, targs.At(i), imports) } } } func (m *MethodScope) populateImports(ctx context.Context, t types.Type) map[string]*Package { imports := map[string]*Package{} m.populateImportsHelper(ctx, t, imports) return imports } // populateImportsHelper extracts all the package imports for a given type // recursively. The imported packages by a single type can be more than // one (ex: map[a.Type]b.Type). // // Returned are the imports that were added for the given type. func (m *MethodScope) populateImportsHelper(ctx context.Context, t types.Type, imports map[string]*Package) { log := zerolog.Ctx(ctx).With(). Str("type-str", t.String()).Logger() switch t := t.(type) { case *types.Named: m.populateImportNamedType(ctx, t, imports) case *types.Alias: m.populateImportNamedType(ctx, t, imports) case *types.Array: m.populateImportsHelper(ctx, t.Elem(), imports) case *types.Slice: m.populateImportsHelper(ctx, t.Elem(), imports) case *types.Signature: for i := 0; i < t.Params().Len(); i++ { m.populateImportsHelper(ctx, t.Params().At(i).Type(), imports) } for i := 0; i < t.Results().Len(); i++ { m.populateImportsHelper(ctx, t.Results().At(i).Type(), imports) } case *types.Map: m.populateImportsHelper(ctx, t.Key(), imports) m.populateImportsHelper(ctx, t.Elem(), imports) case *types.Chan: m.populateImportsHelper(ctx, t.Elem(), imports) case *types.Pointer: m.populateImportsHelper(ctx, t.Elem(), imports) case *types.Struct: // anonymous struct for i := 0; i < t.NumFields(); i++ { m.populateImportsHelper(ctx, t.Field(i).Type(), imports) } case *types.Union: log.Debug().Int("len", t.Len()).Msg("found union") for i := 0; i < t.Len(); i++ { term := t.Term(i) m.populateImportsHelper(ctx, term.Type(), imports) } case *types.Interface: // anonymous interface log.Debug(). Int("num-methods", t.NumMethods()). Int("num-explicit-methods", t.NumExplicitMethods()). Int("num-embeddeds", t.NumEmbeddeds()). Msg("found interface") for i := 0; i < t.NumExplicitMethods(); i++ { log.Debug().Msg("populating import from explicit method") m.populateImportsHelper(ctx, t.ExplicitMethod(i).Type(), imports) } for i := 0; i < t.NumEmbeddeds(); i++ { log.Debug().Msg("populating import form embedded type") m.populateImportsHelper(ctx, t.EmbeddedType(i), imports) } case *types.Basic: if t.Kind() == types.UnsafePointer { m.addImport(ctx, types.Unsafe, imports) } default: log.Debug().Str("real-type", fmt.Sprintf("%T", t)).Msg("unable to determine type of object") } } ================================================ FILE: template/package.go ================================================ package template type TypesPackage interface { Name() string Path() string } // Package represents an imported package. type Package struct { pkg TypesPackage Alias string } // NewPackage creates a new instance of Package. func NewPackage(pkg TypesPackage) *Package { return &Package{pkg: pkg} } func (p *Package) ImportStatement() string { if p.Alias == "" { return `"` + p.Path() + `"` } return p.Alias + ` "` + p.Path() + `"` } // Qualifier returns the qualifier which must be used to refer to types // declared in the package. func (p *Package) Qualifier() string { if p == nil { return "" } if p.Alias != "" { return p.Alias } return p.pkg.Name() } // Path is the full package import path (without vendor). func (p *Package) Path() string { if p == nil { return "" } return p.pkg.Path() } ================================================ FILE: template/packages.go ================================================ package template import "fmt" type Packages []*Package // PkgQualifier returns the qualifier for the given pkgPath. If the pkgPath does // not exist in the container, an error is returned. func (p Packages) PkgQualifier(pkgPath string) (string, error) { for _, imprt := range p { if imprt.Path() == pkgPath { return imprt.Qualifier(), nil } } return "", fmt.Errorf("unknown import %s", pkgPath) } ================================================ FILE: template/param.go ================================================ package template import ( "fmt" "strings" ) // Param is the data which represents a parameter to some method of // an interface. type Param struct { Var *Var Variadic bool } // Name returns the name of the parameter. func (p Param) Name() string { return p.Var.Name } func (p Param) methodArg(includeNames bool) string { var arg string if includeNames { arg += p.Name() + " " } if p.Variadic { arg += fmt.Sprintf("...%s", p.TypeString()[2:]) } else { arg += p.TypeString() } return arg } // MethodArg is the representation of the parameter in the function // signature, ex: 'name a.Type'. func (p Param) MethodArg() string { return p.methodArg(true) } // MethodArgNoName is the same as MethodArg except the argument name is not included. func (p Param) MethodArgNoName() string { return p.methodArg(false) } // CallName returns the string representation of the parameter to be // used for a method call. For a variadic paramter, it will be of the // format 'foos...' if ellipsis is true. func (p Param) CallName(ellipsis bool) string { if ellipsis && p.Variadic { return p.Name() + "..." } return p.Name() } // TypeString returns the string representation of the type of the // parameter. func (p Param) TypeString() string { return p.Var.TypeString() } // TypeStringEllipsis returns the string representation of the type of the // parameter. If it is a variadic parameter, it will be represented as a // variadic parameter instead of a slice. For example instead of `[]string`, // it will return `...string`. func (p Param) TypeStringEllipsis() string { typeString := p.TypeString() if !p.Variadic { return typeString } return strings.Replace(typeString, "[]", "...", 1) } // TypeStringVariadicUnderlying returns the underlying type of a variadic parameter. For // instance, if a function has a parameter defined as `foo ...int`, this function // will return "int". If the parameter is not variadic, this will behave the same // as `TypeString`. func (p Param) TypeStringVariadicUnderlying() string { typeString := p.TypeStringEllipsis() return strings.Replace(typeString, "...", "", 1) } ================================================ FILE: template/registry.go ================================================ package template import ( "context" "fmt" "go/types" "sort" "github.com/rs/zerolog" "github.com/vektra/mockery/v3/internal/stackerr" "golang.org/x/tools/go/packages" ) // Registry encapsulates types information for the source and mock // destination package. For the mock package, it tracks the list of // imports and ensures there are no conflicts in the imported package // qualifiers. type Registry struct { dstPkgPath string srcPkg *packages.Package srcPkgName string imports map[string]*Package importQualifiers map[string]*Package // inPackage specifies whether this registry is considered to be in the same // package as the srcPkg. This is needed because of the way that Go package // qualifiers work. For example, test files for a package are allowed to have // a different package name than the files under test, in which case they are // considered to be in a separate package. In such a case, `inPackage` should // be set to false such that calls to AddImport for the original source package // are not ignored. Otherwise if it's set to true, AddImport ignores imports // for the package in which the file already resides. inPackage bool } // New loads the source package info and returns a new instance of // Registry. func NewRegistry(srcPkg *packages.Package, dstPkgPath string, inPackage bool) (*Registry, error) { return &Registry{ dstPkgPath: dstPkgPath, srcPkg: srcPkg, imports: make(map[string]*Package), importQualifiers: make(map[string]*Package), inPackage: inPackage, }, nil } func (r Registry) SrcPkg() *packages.Package { return r.srcPkg } // SrcPkgName returns the name of the source package. func (r Registry) SrcPkgName() string { return r.srcPkg.Name } // LookupInterface returns the underlying interface definition of the // given interface name. func (r Registry) LookupInterface(name string) (*types.Interface, *types.TypeParamList, error) { obj := r.SrcPkg().Types.Scope().Lookup(name) if obj == nil { return nil, nil, stackerr.NewStackErr(fmt.Errorf("interface not found: %s", name)) } if !types.IsInterface(obj.Type()) { return nil, nil, fmt.Errorf("%s (%s) is not an interface", name, obj.Type()) } var tparams *types.TypeParamList named, ok := obj.Type().(*types.Named) if ok { tparams = named.TypeParams() } return obj.Type().Underlying().(*types.Interface).Complete(), tparams, nil } // MethodScope returns a new MethodScope. func (r *Registry) MethodScope() *MethodScope { return NewMethodScope(r) } type fakeTypesPackage struct { name string path string } func (f fakeTypesPackage) Name() string { return f.name } func (f fakeTypesPackage) Path() string { return f.path } // addImport adds the given package to the set of imports. It generates a // suitable alias if there are any conflicts with previously imported // packages. pkgName must be set to the unaliased package name. func (r *Registry) AddImport(pkgName string, pkgPath string) *Package { // Note: Yes this method is a little weird. This is intended to be used // by templates that want to add their own imports. Instead of requiring the // templates to pass in a ctx and TypesPackage instance, we create this new // AddImport method that wraps around r.addImport. r.addImport still exists // because mockery will add its own imports based on the existing types, and // in that case we want it to pass ctx (that contains the logger) and the // real types.Package type. return r.addImport(context.Background(), fakeTypesPackage{ name: pkgName, path: pkgPath, }) } func (r *Registry) addImport(ctx context.Context, pkg TypesPackage) *Package { path := pkg.Path() logContext := zerolog.Ctx(ctx).With(). Str("method", "AddImport"). Str("dst-pkg-path", r.dstPkgPath). Str("pkg-path", path). Bool("inpackage", r.inPackage) if r.srcPkg != nil { logContext = logContext.Str("src-pkg-path", r.srcPkg.PkgPath) } log := logContext.Logger() if r.srcPkg != nil && path == r.srcPkg.PkgPath && r.inPackage { log.Debug().Msg("package path equals src-pkg-path, not adding import") return nil } else { log.Debug().Msg("package path does not equal src-pkg-path, adding import") } if imprt, ok := r.imports[path]; ok { return imprt } imprt := Package{pkg: pkg} originalQualifier := imprt.Qualifier() var aliasSuggestion string = imprt.Qualifier() for i := 0; ; i++ { if _, conflict := r.importQualifiers[aliasSuggestion]; conflict { aliasSuggestion = fmt.Sprintf("%s%d", imprt.Qualifier(), i) continue } if originalQualifier != aliasSuggestion { imprt.Alias = aliasSuggestion } break } r.imports[path] = &imprt r.importQualifiers[imprt.Qualifier()] = &imprt return &imprt } // Imports returns the list of imported packages. The list is sorted by // path. func (r Registry) Imports() Packages { imports := make([]*Package, 0, len(r.imports)) for _, imprt := range r.imports { imports = append(imports, imprt) } sort.Slice(imports, func(i, j int) bool { return imports[i].Path() < imports[j].Path() }) return imports } ================================================ FILE: template/template.go ================================================ // Package template provides data and functionality for rendering templates using mockery. // The data and methods herein are guaranteed to be backwards compatible, as they // are used directly by user-defined Go templates. It is safe to import or use // this package for any purpose. package template import ( "io" "text/template" "github.com/vektra/mockery/v3/template_funcs" ) // Template represents the template requested for rendering. type Template struct { tmpl *template.Template } // New returns a new instance of Template. func New(templateString string, name string) (Template, error) { tmpl, err := template.New(name).Funcs(template_funcs.FuncMap).Parse(templateString) if err != nil { return Template{}, err } return Template{tmpl: tmpl}, nil } // Execute generates and writes the Moq implementation for the given // data. func (t Template) Execute(w io.Writer, data Data) error { return t.tmpl.Execute(w, data) } ================================================ FILE: template/template_data.go ================================================ package template import ( "context" "errors" "fmt" "github.com/rs/zerolog" "github.com/xeipuuv/gojsonschema" ) var ErrTemplateDataSchemaValidation = errors.New("unable to verify template-data schema") type TemplateData map[string]any // VerifyJSONSchema verifies that the contents of the type adhere to the schema // defined by the schema argument. // // This method is not meant to be used directly by templates. func (t TemplateData) VerifyJSONSchema(ctx context.Context, schema *gojsonschema.Schema) error { log := zerolog.Ctx(ctx) result, err := schema.Validate(gojsonschema.NewGoLoader(t)) if err != nil { return fmt.Errorf("validating json schema: %w", err) } if !result.Valid() { log.Error().Msg("issue with template-data json schema, see messages below:") for _, resultErr := range result.Errors() { log.Error().Msg(resultErr.String()) } return ErrTemplateDataSchemaValidation } log.Debug().Msg("validated json schema successfully") return nil } ================================================ FILE: template/template_test.go ================================================ package template import ( "context" "go/types" "os" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestTemplateMockFuncs(t *testing.T) { tests := []struct { name string inTemplate string dataInit func() Data want string }{ { name: "importStatement", inTemplate: "{{- range .Imports}}{{ .ImportStatement }}{{- end}}", dataInit: func() Data { imprt := NewPackage(types.NewPackage("xyz", "xyz")) imprt.Alias = "x" registry, err := NewRegistry(nil, "", false) require.NoError(t, err) registry.addImport(context.Background(), imprt.pkg) return Data{Registry: registry} }, want: `"xyz"`, }, { name: "PkgQualifier", inTemplate: `{{$.Imports.PkgQualifier "sync"}}`, dataInit: func() Data { registry, err := NewRegistry(nil, "", false) require.NoError(t, err) registry.addImport(context.Background(), NewPackage(types.NewPackage("sync", "sync")).pkg) registry.addImport(context.Background(), NewPackage(types.NewPackage("github.com/some/module", "module")).pkg) return Data{Registry: registry} }, want: "sync", }, { name: "PkgQualifier conflicting pkg names", inTemplate: `{{$.Imports.PkgQualifier "github.com/someother/sync"}}`, dataInit: func() Data { registry, err := NewRegistry(nil, "", false) require.NoError(t, err) registry.AddImport("sync", "sync") registry.AddImport("sync", "github.com/someother/sync") return Data{Registry: registry} }, want: "sync0", }, { name: "exported empty", inTemplate: "{{exported .TemplateData.var}}", dataInit: func() Data { return Data{TemplateData: map[string]any{"var": ""}} }, want: "", }, { name: "exported var", inTemplate: "{{exported .TemplateData.var}}", dataInit: func() Data { return Data{TemplateData: map[string]any{"var": "someVar"}} }, want: "SomeVar", }, { name: "exported acronym", inTemplate: "{{exported .TemplateData.var}}", dataInit: func() Data { return Data{TemplateData: map[string]any{"var": "sql"}} }, want: "SQL", }, { name: "ImplementsSomeMethod", inTemplate: "{{ .Interfaces.ImplementsSomeMethod }}", dataInit: func() Data { // MethodData has to have at least 1 element to pass. return Data{Interfaces: []Interface{{Methods: []Method{{}}}}} }, want: "true", }, { name: "typeConstraint", inTemplate: "{{ (index .Interfaces 0).TypeConstraintTest }}", dataInit: func() Data { return Data{Interfaces: []Interface{{ TypeParams: []TypeParam{{ Param: Param{ Var: &Var{Name: "t", typ: &types.Slice{}}, }, }}, }}} }, want: "[t []]", }, { name: "readFile", inTemplate: "{{readFile .TemplateData.f}}", dataInit: func() Data { f, err := os.CreateTemp(".", "readFileTest") require.NoError(t, err) defer f.Close() t.Cleanup(func() { os.Remove(f.Name()) }) _, err = f.WriteString("content") require.NoError(t, err) return Data{TemplateData: map[string]any{"f": f.Name()}} }, want: "content", }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel() tt, err := New(tc.inTemplate, tc.name) require.NoError(t, err) var sb strings.Builder err = tt.Execute(&sb, tc.dataInit()) require.NoError(t, err) assert.Equal(t, tc.want, sb.String()) }) } } ================================================ FILE: template/type_param_data.go ================================================ package template import "go/types" type TypeParam struct { Param Constraint types.Type } ================================================ FILE: template/var.go ================================================ package template import ( "go/types" "strings" ) // Var represents a method variable/parameter. // // It should be created using a method scope instance. type Var struct { vr *types.Var // typ is stored separately from `vr.Type()` because it's possible // for a variable to be replaced with another variable via replace-type. // In such a case, `vr.Type()` refers to the original type and `typ` refers // to the replacer type. typ types.Type imports map[string]*Package pkgPath string Name string } func (v Var) Type() types.Type { return v.typ } // IsSlice returns whether the type (or the underlying type) is a slice. func (v Var) IsSlice() bool { _, ok := v.Type().Underlying().(*types.Slice) return ok } // TypeString returns the variable type with the package qualifier in the // format 'pkg.Type'. func (v Var) TypeString() string { return types.TypeString(v.Type(), v.packageQualifier) } // packageQualifier is a types.Qualifier. func (v Var) packageQualifier(pkg *types.Package) string { path := pkg.Path() if v.pkgPath != "" && v.pkgPath == path { return "" } return v.imports[path].Qualifier() } func nillable(typ types.Type) bool { switch t := typ.(type) { case *types.Pointer, *types.Array, *types.Map, *types.Interface, *types.Signature, *types.Chan, *types.Slice: return true case *types.Named, *types.Alias, *types.TypeParam: return nillable(t.Underlying()) } return false } func (v Var) Nillable() bool { return nillable(v.Type()) } func varName(vr *types.Var, suffix string) string { name := vr.Name() if name != "" && name != "_" { return name + suffix } name = varNameForType(vr.Type()) + suffix switch name { case "mock", "callInfo", "break", "default", "func", "interface", "select", "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", "continue", "for", "import", "return", "var", // avoid shadowing basic types "string", "bool", "byte", "rune", "uintptr", "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "float32", "float64", "complex64", "complex128": name += "Param" } return name } // varNameForType generates a name for the variable using the type // information. // // Examples: // - string -> s // - int -> n // - chan int -> intCh // - []a.MyType -> myTypes // - map[string]int -> stringToInt // - error -> err // - a.MyType -> myType func varNameForType(t types.Type) string { nestedType := func(t types.Type) string { if t, ok := t.(*types.Basic); ok { return deCapitalise(t.String()) } return varNameForType(t) } switch t := t.(type) { case *types.Named: if t.Obj().Name() == "error" { return "err" } name := deCapitalise(t.Obj().Name()) if name == t.Obj().Name() { name += "MoqParam" } return name case *types.Basic: return basicTypeVarName(t) case *types.Array: return nestedType(t.Elem()) + "s" case *types.Slice: return nestedType(t.Elem()) + "s" case *types.Struct: // anonymous struct return "val" case *types.Pointer: return varNameForType(t.Elem()) case *types.Signature: return "fn" case *types.Interface: // anonymous interface return "ifaceVal" case *types.Map: return nestedType(t.Key()) + "To" + capitalise(nestedType(t.Elem())) case *types.Chan: return nestedType(t.Elem()) + "Ch" } return "v" } func basicTypeVarName(b *types.Basic) string { switch b.Info() { case types.IsBoolean: return "b" case types.IsInteger: return "n" case types.IsFloat: return "f" case types.IsString: return "s" } return "v" } func capitalise(s string) string { return strings.ToUpper(s[:1]) + s[1:] } func deCapitalise(s string) string { return strings.ToLower(s[:1]) + s[1:] } ================================================ FILE: template_funcs/funcmap.go ================================================ // Package shared provides variables/objects that need to be shared // across multiple packages. The main purpose is to resolve cyclical imports // arising from multiple packages needing to share common utilies. package template_funcs import ( "math" "math/rand/v2" "os" "path/filepath" "regexp" "strings" "text/template" "github.com/huandu/xstrings" ) // This list comes from the golint codebase. Golint will complain about any of // these being mixed-case, like "Id" instead of "ID". var golintInitialisms = []string{ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "LHS", "QPS", "RAM", "RHS", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", } //nolint:predeclared var FuncMap = template.FuncMap{ // String inspection and manipulation. Note that the first argument is replaced // as the last argument in some functions in order to support chained // template pipelines. "contains": func(substr string, s string) bool { return strings.Contains(s, substr) }, "hasPrefix": func(prefix string, s string) bool { return strings.HasPrefix(s, prefix) }, "hasSuffix": func(suffix string, s string) bool { return strings.HasSuffix(s, suffix) }, "join": func(sep string, elems []string) string { return strings.Join(elems, sep) }, "replace": func(old string, new string, n int, s string) string { return strings.Replace(s, old, new, n) }, "replaceAll": func(old string, new string, s string) string { return strings.ReplaceAll(s, old, new) }, "split": func(sep string, s string) []string { return strings.Split(s, sep) }, "splitAfter": func(sep string, s string) []string { return strings.SplitAfter(s, sep) }, "splitAfterN": func(sep string, n int, s string) []string { return strings.SplitAfterN(s, sep, n) }, "trim": func(cutset string, s string) string { return strings.Trim(s, cutset) }, "trimLeft": func(cutset string, s string) string { return strings.TrimLeft(s, cutset) }, "trimPrefix": func(prefix string, s string) string { return strings.TrimPrefix(s, prefix) }, "trimRight": func(cutset string, s string) string { return strings.TrimRight(s, cutset) }, "trimSpace": strings.TrimSpace, "trimSuffix": func(suffix string, s string) string { return strings.TrimSuffix(s, suffix) }, "lower": strings.ToLower, "upper": strings.ToUpper, "camelcase": xstrings.ToCamelCase, "snakecase": xstrings.ToSnakeCase, "kebabcase": xstrings.ToKebabCase, "firstIsLower": FirstIsLower, "firstLower": xstrings.FirstRuneToLower, "firstUpper": xstrings.FirstRuneToUpper, "exported": Exported, // Regular expression matching "matchString": regexp.MatchString, "quoteMeta": regexp.QuoteMeta, // Filepath manipulation "base": func(path string) string { return filepath.ToSlash(filepath.Base(path)) }, "clean": func(path string) string { return filepath.ToSlash(filepath.Clean(path)) }, "dir": func(path string) string { return filepath.ToSlash(filepath.Dir(path)) }, "readFile": ReadFile, // Basic access to reading environment variables "expandEnv": os.ExpandEnv, "getenv": os.Getenv, /******* * MATH * ********/ // int "add": Add[int], "decr": Decr[int], "div": Div[int], "incr": Incr[int], "min": Min[int], "mod": Mod[int], "mul": Mul[int], "sub": Sub[int], // float64 "ceil": math.Ceil, "floor": math.Floor, "round": math.Round, // rand "randInt": rand.Int, } ================================================ FILE: template_funcs/funcmap_test.go ================================================ package template_funcs import ( "os" "regexp" "strings" "testing" "text/template" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) type Data struct { TemplateData map[string]any } func TestTemplateStringFuncs(t *testing.T) { // For env tests os.Setenv("MOCKERY_TEST_ENV", "TEST") tests := []struct { name string template string data map[string]any want string wantRegex string }{ { name: "contains", template: "{{contains .TemplateData.sub .TemplateData.str}}", data: map[string]any{"str": "golang", "sub": "go"}, want: "true", }, { name: "hasPrefix", template: "{{hasPrefix .TemplateData.pre .TemplateData.str}}", data: map[string]any{"str": "golang", "pre": "go"}, want: "true", }, { name: "hasSuffix", template: "{{hasSuffix .TemplateData.suf .TemplateData.str}}", data: map[string]any{"str": "golang", "suf": "lang"}, want: "true", }, { name: "join", template: "{{join .TemplateData.sep .TemplateData.elems}}", data: map[string]any{"elems": []string{"1", "2", "3"}, "sep": ","}, want: "1,2,3", }, { name: "replace", template: "{{replace .TemplateData.old .TemplateData.new .TemplateData.n .TemplateData.s}}", data: map[string]any{"old": "old", "new": "new", "n": 2, "s": "oldoldold"}, want: "newnewold", }, { name: "replaceAll", template: "{{replaceAll .TemplateData.old .TemplateData.new .TemplateData.s}}", data: map[string]any{"old": "old", "new": "new", "s": "oldoldold"}, want: "newnewnew", }, // String splitting { name: "split", template: "{{split .TemplateData.sep .TemplateData.s}}", data: map[string]any{"s": "a,b,c", "sep": ","}, want: "[a b c]", }, { name: "splitAfter", template: "{{splitAfter .TemplateData.sep .TemplateData.s}}", data: map[string]any{"s": "a,b,c", "sep": ","}, want: "[a, b, c]", }, { name: "splitAfterN", template: "{{splitAfterN .TemplateData.sep .TemplateData.n .TemplateData.s}}", data: map[string]any{"s": "a,b,c,d", "sep": ",", "n": 2}, want: "[a, b,c,d]", }, // Trimming functions { name: "trim", template: "{{trim .TemplateData.cutset .TemplateData.s}}", data: map[string]any{"s": "---hello---", "cutset": "-"}, want: "hello", }, { name: "trimLeft", template: "{{trimLeft .TemplateData.cutset .TemplateData.s}}", data: map[string]any{"s": "---hello---", "cutset": "-"}, want: "hello---", }, { name: "trimRight", template: "{{trimRight .TemplateData.cutset .TemplateData.s}}", data: map[string]any{"s": "---hello---", "cutset": "-"}, want: "---hello", }, { name: "trimPrefix", template: "{{trimPrefix .TemplateData.prefix .TemplateData.s}}", data: map[string]any{"s": "prefix_text", "prefix": "prefix_"}, want: "text", }, { name: "trimSuffix", template: "{{trimSuffix .TemplateData.suffix .TemplateData.s}}", data: map[string]any{"s": "text_suffix", "suffix": "_suffix"}, want: "text", }, { name: "trimSpace", template: "{{trimSpace .TemplateData.s}}", data: map[string]any{"s": " hello world "}, want: "hello world", }, // Casing functions { name: "lower", template: "{{lower .TemplateData.s}}", data: map[string]any{"s": "GoLang"}, want: "golang", }, { name: "upper", template: "{{upper .TemplateData.s}}", data: map[string]any{"s": "golang"}, want: "GOLANG", }, { name: "camelcase", template: "{{camelcase .TemplateData.s}}", data: map[string]any{"s": "hello_world"}, want: "helloWorld", }, { name: "snakecase", template: "{{snakecase .TemplateData.s}}", data: map[string]any{"s": "HelloWorld"}, want: "hello_world", }, { name: "kebabcase", template: "{{kebabcase .TemplateData.s}}", data: map[string]any{"s": "HelloWorld"}, want: "hello-world", }, { name: "firstLower", template: "{{firstLower .TemplateData.s}}", data: map[string]any{"s": "GoLang"}, want: "goLang", }, { name: "firstUpper", template: "{{firstUpper .TemplateData.s}}", data: map[string]any{"s": "golang"}, want: "Golang", }, // Regex functions { name: "matchString", template: "{{matchString .TemplateData.pattern .TemplateData.s}}", data: map[string]any{"pattern": "go.*", "s": "golang"}, want: "true", }, { name: "quoteMeta", template: "{{quoteMeta .TemplateData.s}}", data: map[string]any{"s": "1+1=2"}, want: `1\+1=2`, }, // Filepath manipulation { name: "base", template: "{{base .TemplateData.s}}", data: map[string]any{"s": "/home/user/file.txt"}, want: "file.txt", }, { name: "clean", template: "{{clean .TemplateData.s}}", data: map[string]any{"s": "/home/user/../file.txt"}, want: "/home/file.txt", }, { name: "dir", template: "{{dir .TemplateData.s}}", data: map[string]any{"s": "/home/user/file.txt"}, want: "/home/user", }, // Environment variables { name: "getenv", template: "{{getenv .TemplateData.s}}", data: map[string]any{"s": "MOCKERY_TEST_ENV"}, want: "TEST", }, { name: "expandEnv", template: "{{expandEnv .TemplateData.s}}", data: map[string]any{"s": "${MOCKERY_TEST_ENV}"}, want: "TEST", }, // Arithmetic { name: "add", template: "{{add .TemplateData.i1 .TemplateData.i2}}", data: map[string]any{"i1": 5, "i2": 10}, want: "15", }, { name: "decr", template: "{{decr 15}}", want: "14", }, { name: "div", template: "{{div 28 7}}", want: "4", }, { name: "incr", template: "{{incr 1}}", want: "2", }, { name: "min", template: "{{min 2 4 6}}", want: "2", }, { name: "mod", template: "{{mod 5 2}}", want: "1", }, { name: "mul", template: "{{mul 5 2}}", want: "10", }, { name: "sub", template: "{{sub 5 2}}", want: "3", }, { name: "ceil", template: "{{ceil 1.71}}", want: "2", }, { name: "floor", template: "{{floor 1.71}}", want: "1", }, { name: "round 1.6", template: "{{round 1.6}}", want: "2", }, { name: "round 1.4", template: "{{round 1.4}}", want: "1", }, { name: "randInt", template: "{{randInt}}", wantRegex: "%d", }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel() tmpl, err := template.New(tc.name).Funcs(FuncMap).Parse(tc.template) require.NoError(t, err) var sb strings.Builder err = tmpl.Execute(&sb, Data{TemplateData: tc.data}) require.NoError(t, err) if tc.wantRegex == "" { assert.Equal(t, tc.want, sb.String()) } else { re, err := regexp.Compile(tc.wantRegex) require.NoError(t, err) re.Match([]byte(sb.String())) } }) } } ================================================ FILE: template_funcs/functions.go ================================================ package template_funcs import ( "cmp" "os" "slices" "strings" "unicode" "golang.org/x/exp/constraints" ) func Exported(s string) string { if s == "" { return "" } for _, initialism := range golintInitialisms { if strings.ToUpper(s) == initialism { return initialism } } return strings.ToUpper(s[0:1]) + s[1:] } func ReadFile(path string) (string, error) { if path == "" { return "", nil } fileBytes, err := os.ReadFile(path) if err != nil { return "", err } return string(fileBytes), nil } // Numbers defines the generic constraints of the arithmetic arguments. type Numbers interface { constraints.Integer | constraints.Float | constraints.Complex } // Add adds the given numbers. func Add[T Numbers](i1 T, in ...T) T { var sum T = i1 for _, i := range in { sum += i } return sum } // Incr increments the numbers by 1. func Incr[T Numbers](i T) T { return i + 1 } // Decr decrements the numbers by 1. func Decr[T Numbers](i T) T { return i - 1 } // Sub subtracts the given numbers. func Sub[T Numbers](i1 T, in ...T) T { var sub T = i1 for _, i := range in { sub -= i } return sub } // Div cumulatively divides the given numbers. func Div[T Numbers](i1 T, in ...T) T { var sub T = i1 for _, i := range in { sub /= i } return sub } // Mod returns the cumulative modulo of the given numbers. func Mod[T constraints.Integer](i1 T, in ...T) T { var sub T = i1 for _, i := range in { sub = sub % i } return sub } // Mul returns the cumulative multiplication of the given numbers. func Mul[T Numbers](i1 T, in ...T) T { var sub T = i1 for _, i := range in { sub *= i } return sub } // Max returns the maximum value. func Max[T cmp.Ordered](x ...T) T { return slices.Max(x) } // Min returns the minimum value. func Min[T cmp.Ordered](x ...T) T { return slices.Min(x) } // FirstIsLower returns whether or not the string's first character is lowercase. // If the string is empty, false is returned. If the first character is a non-alphabetic // character, false is returned. func FirstIsLower(s string) bool { first := rune(s[0]) if len(s) == 0 || !unicode.IsLetter(first) { return false } return !unicode.IsUpper(first) } ================================================ FILE: template_funcs/functions_test.go ================================================ package template_funcs import "testing" func TestFirstIsLower(t *testing.T) { tests := []struct { arg string want bool }{ { arg: "Exported", want: false, }, { arg: "unexported", want: true, }, { arg: "1234", want: false, }, { arg: "MockargGetter", want: false, }, } for _, tt := range tests { t.Run(tt.arg, func(t *testing.T) { if got := FirstIsLower(tt.arg); got != tt.want { t.Errorf("FirstIsLower() = %v, want %v", got, tt.want) } }) } } ================================================ FILE: tools/cmd/root.go ================================================ package cmd import ( "fmt" "os" "github.com/go-errors/errors" "github.com/rs/zerolog" "github.com/spf13/cobra" "github.com/spf13/viper" ) var logger zerolog.Logger type timestampHook struct{} func (t timestampHook) Run(e *zerolog.Event, level zerolog.Level, message string) { e.Timestamp() } func maybeExit(err error) { printStack(err) if err != nil { os.Exit(1) } } func newViper() *viper.Viper { v := viper.New() v.SetConfigType("env") v.SetConfigName("mockery-tools") v.AddConfigPath(".") v.AddConfigPath("../") v.SetEnvPrefix("MOCKERYTOOLS") maybeExit(v.ReadInConfig()) return v } func NewRootCmd() *cobra.Command { cmd := &cobra.Command{ Use: "mockery_tools [command]", } logger = zerolog.New(zerolog.ConsoleWriter{ Out: os.Stderr, }).Hook(timestampHook{}) subCommands := []func(v *viper.Viper) (*cobra.Command, error){ NewTagCmd, } for _, CommandFunc := range subCommands { subCmd, err := CommandFunc(newViper()) if err != nil { panic(err) } cmd.AddCommand(subCmd) } return cmd } func printStack(err error) { if err == nil { return } newErr, ok := err.(*errors.Error) if ok { fmt.Fprintf(os.Stderr, "%v\n", newErr.ErrorStack()) } else { fmt.Fprintf(os.Stderr, "%v\n", err) } } ================================================ FILE: tools/cmd/tag.go ================================================ package cmd import ( "fmt" "os" "strings" "time" "github.com/Masterminds/semver/v3" "github.com/go-errors/errors" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-playground/validator/v10" "github.com/spf13/cobra" "github.com/spf13/viper" ) var ErrNoNewVersion = errors.New("no new version specified") var EXIT_CODE_NO_NEW_VERSION = 8 func NewTagCmd(v *viper.Viper) (*cobra.Command, error) { if err := v.ReadInConfig(); err != nil { return nil, err } cmd := &cobra.Command{ Use: "tag", Run: func(cmd *cobra.Command, args []string) { tagger, err := NewTagger(v) if err != nil { printStack(err) os.Exit(1) } requestedVersion, previousVersion, err := tagger.Tag() if requestedVersion != nil && previousVersion != nil { fmt.Fprintf(os.Stdout, "v%s,v%s", requestedVersion.String(), previousVersion.String()) } if err != nil { if errors.Is(ErrNoNewVersion, err) { os.Exit(EXIT_CODE_NO_NEW_VERSION) } printStack(err) os.Exit(1) } }, } flags := cmd.PersistentFlags() flags.Bool("dry-run", true, "print, but do not perform, any actions") viper.BindPFlag("dry-run", flags.Lookup("dry-run")) return cmd, nil } func (t *Tagger) createTag(repo *git.Repository, version string) error { hash, err := repo.Head() if err != nil { return errors.New(err) } if t.DryRun { logger.Info().Str("tag", version).Msg("would have created tag") return nil } majorVersion := strings.Split(version, ".")[0] for _, v := range []string{version, majorVersion} { if err := repo.DeleteTag(v); err != nil { logger.Warn().Err(err).Str("tag", v).Msg("failed to delete tag, might be okay.") } _, err = repo.CreateTag(v, hash.Hash(), &git.CreateTagOptions{ Tagger: &object.Signature{ Name: "Landon Clipp", Email: "11232769+LandonTClipp@users.noreply.github.com", When: time.Now(), }, Message: v, }) if err != nil { return errors.New(err) } } logger.Info().Str("tag", version).Msg("tag successfully created") return nil } func (t *Tagger) largestTagSemver(repo *git.Repository, major uint64) (*semver.Version, error) { largestTag, err := semver.NewVersion("v0.0.0") if err != nil { return nil, errors.New(err) } iter, err := repo.Tags() if err != nil { return nil, errors.New(err) } if err := iter.ForEach(func(ref *plumbing.Reference) error { var versionString string tag, err := repo.TagObject(ref.Hash()) switch err { case nil: case plumbing.ErrObjectNotFound: // Not a tag object default: // Some other error return errors.New(err) } if err != nil { if errors.Is(plumbing.ErrObjectNotFound, err) { // Tag is lightweight tag versionString = ref.Name().Short() } else { logger.Err(err). Str("hash", ref.Hash().String()). Str("name", ref.Name().String()). Msg("error when retrieving tag object") return errors.New(err) } } else { versionString = tag.Name } versionParts := strings.Split(versionString, ".") if len(versionParts) < 3 { // This is not a full version tag, so ignore it return nil } version, err := semver.NewVersion(versionString) if err != nil { return errors.New(err) } if version.GreaterThan(largestTag) && version.Major() == major { largestTag = version } return nil }); err != nil { return nil, err } return largestTag, nil } func NewTagger(v *viper.Viper) (*Tagger, error) { t := &Tagger{} if err := v.Unmarshal(t); err != nil { return nil, errors.New(err) } logger.Info().Msgf("Using config: %s", v.ConfigFileUsed()) if err := validator.New( validator.WithRequiredStructEnabled(), ).Struct(t); err != nil { return nil, errors.New(err) } return t, nil } type Tagger struct { DryRun bool `mapstructure:"dry-run"` Version string `mapstructure:"version" validate:"required"` } func (t *Tagger) Tag() (requestedVersion *semver.Version, previousVersion *semver.Version, err error) { repo, err := git.PlainOpen(".") if err != nil { return nil, nil, errors.New(err) } requestedVersion, err = semver.NewVersion(t.Version) if err != nil { logger.Err(err).Str("requested-version", string(t.Version)).Msg("error when constructing semver from version config") return requestedVersion, nil, errors.New(err) } previousVersion, err = t.largestTagSemver(repo, requestedVersion.Major()) if err != nil { return requestedVersion, previousVersion, err } logger := logger.With(). Stringer("previous-version", previousVersion).Logger() logger.Info().Msg("found largest semver tag") logger = logger.With(). Stringer("requested-version", requestedVersion). Logger() if !requestedVersion.GreaterThan(previousVersion) { logger.Info(). Msg("VERSION is not greater than latest git tag, nothing to do.") return requestedVersion, previousVersion, ErrNoNewVersion } worktree, err := repo.Worktree() if err != nil { return requestedVersion, previousVersion, errors.New(err) } status, err := worktree.Status() if err != nil { return requestedVersion, previousVersion, errors.New(err) } if !status.IsClean() { logger.Error().Msg("git is in a dirty state, can't tag.") fmt.Println(status.String()) return requestedVersion, previousVersion, errors.New("dirty git state") } if err := t.createTag(repo, fmt.Sprintf("v%s", requestedVersion.String())); err != nil { return requestedVersion, previousVersion, err } logger.Info().Msg("created new tag. Push to origin still required.") return requestedVersion, previousVersion, nil } ================================================ FILE: tools/go.mod ================================================ module github.com/vektra/mockery/tools go 1.24.0 require ( github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.13.0 github.com/go-playground/validator/v10 v10.23.0 github.com/go-task/task/v3 v3.38.0 github.com/golangci/golangci-lint v1.60.3 github.com/rs/zerolog v1.33.0 gotest.tools/gotestsum v1.11.0 ) require ( dario.cat/mergo v1.0.0 // indirect github.com/4meepo/tagalign v1.3.4 // indirect github.com/Antonboom/testifylint v1.4.3 // indirect github.com/Crocmagnon/fatcontext v0.4.0 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect github.com/Ladicle/tabwriter v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/alecthomas/chroma/v2 v2.14.0 // indirect github.com/alecthomas/go-check-sumtype v0.1.4 // indirect github.com/alexkohler/nakedret/v2 v2.0.4 // indirect github.com/bombsimon/wsl/v4 v4.4.1 // indirect github.com/butuzov/mirror v1.2.0 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/ckaznocha/intrange v0.1.2 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/cyphar/filepath-securejoin v0.2.5 // indirect github.com/dlclark/regexp2 v1.11.0 // indirect github.com/dominikbraun/graph v0.23.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/ghostiam/protogetter v0.3.6 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-task/template v0.0.0-20240602015157-960e6f576656 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golangci/modinfo v0.3.4 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jjti/go-spancheck v0.6.2 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/lasiar/canonicalheader v1.1.1 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/macabu/inamedparam v0.1.3 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/sagikazarmark/locafero v0.9.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/skeema/knownhosts v1.3.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xen0n/gosmopolitan v1.2.2 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect go-simpler.org/musttag v0.12.2 // indirect go-simpler.org/sloglint v0.7.2 // indirect go.uber.org/automaxprocs v1.5.3 // indirect golang.org/x/crypto v0.41.0 // indirect golang.org/x/net v0.43.0 // indirect golang.org/x/tools/go/expect v0.1.1-deprecated // indirect golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect github.com/Abirdcfly/dupword v0.0.14 // indirect github.com/Antonboom/errname v0.1.13 // indirect github.com/Antonboom/nilnil v0.1.9 // indirect; indirectccd github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/Masterminds/semver/v3 v3.2.1 github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bitfield/gotestdox v0.2.1 // indirect github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect github.com/butuzov/ireturn v0.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/daixiang0/gci v0.13.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fatih/structtag v1.2.0 // indirect github.com/firefart/nonamedreturns v1.0.5 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/go-critic/go-critic v0.11.4 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect github.com/go-toolsmith/astfmt v1.1.0 // indirect github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect github.com/golangci/misspell v0.6.0 // indirect github.com/golangci/revgrep v0.5.3 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jgautheron/goconst v1.7.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect github.com/joho/godotenv v1.5.1 // indirect github.com/julz/importas v0.1.0 // indirect github.com/kisielk/errcheck v1.7.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect github.com/kulti/thelper v0.6.3 // indirect github.com/kunwardeep/paralleltest v1.0.10 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect github.com/ldez/gomoddirectives v0.2.4 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/lufeee/execinquery v1.2.1 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-zglob v0.0.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mgechev/revive v1.3.9 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/moricho/tparallel v0.3.2 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.16.2 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.6.0 // indirect github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/quasilyte/go-ruleguard v0.4.2 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/radovskyb/watcher v1.0.7 // indirect github.com/ryancurrah/gomodguard v1.3.3 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sajari/fuzzy v1.0.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect github.com/securego/gosec/v2 v2.20.1-0.20240822074752-ab3f6c1c83a0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/sivchari/tenv v1.10.0 // indirect github.com/sonatard/noctx v0.0.2 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.14.0 // indirect github.com/spf13/cast v1.7.1 // indirect github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.6 // indirect github.com/spf13/viper v1.20.1 github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/stretchr/testify v1.10.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect github.com/tetafro/godot v1.4.16 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect github.com/uudashr/gocognit v1.1.3 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.3.0 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect golang.org/x/mod v0.27.0 // indirect golang.org/x/sync v0.16.0 // indirect golang.org/x/sys v0.35.0 // indirect golang.org/x/term v0.34.0 // indirect golang.org/x/text v0.28.0 // indirect golang.org/x/tools v0.36.0 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect honnef.co/go/tools v0.5.1 // indirect mvdan.cc/gofumpt v0.7.0 mvdan.cc/sh/v3 v3.8.0 // indirect mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect ) ================================================ FILE: tools/go.sum ================================================ 4d63.com/gocheckcompilerdirectives v1.2.1 h1:AHcMYuw56NPjq/2y615IGg2kYkBdTvOaojYCBcRE7MA= 4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= 4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= 4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= github.com/Abirdcfly/dupword v0.0.14 h1:3U4ulkc8EUo+CaT105/GJ1BQwtgyj6+VaBVbAX11Ba8= github.com/Abirdcfly/dupword v0.0.14/go.mod h1:VKDAbxdY8YbKUByLGg8EETzYSuC4crm9WwI6Y3S0cLI= github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM= github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs7DmEck= github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Crocmagnon/fatcontext v0.4.0 h1:4ykozu23YHA0JB6+thiuEv7iT6xq995qS1vcuWZq0tg= github.com/Crocmagnon/fatcontext v0.4.0/go.mod h1:ZtWrXkgyfsYPzS6K3O88va6t2GEglG93vnII/F94WC0= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= github.com/Ladicle/tabwriter v1.0.0 h1:DZQqPvMumBDwVNElso13afjYLNp0Z7pHqHnu0r4t9Dg= github.com/Ladicle/tabwriter v1.0.0/go.mod h1:c4MdCjxQyTbGuQO/gvqJ+IA/89UEwrsD6hUCW98dyp4= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/alecthomas/assert/v2 v2.7.0 h1:QtqSACNS3tF7oasA8CU6A6sXZSBDqnm7RfpLl9bZqbE= github.com/alecthomas/assert/v2 v2.7.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/chroma/v2 v2.14.0 h1:R3+wzpnUArGcQz7fCETQBzO5n9IMNi13iIs46aU4V9E= github.com/alecthomas/chroma/v2 v2.14.0/go.mod h1:QolEbTfmUHIMVpBqxeDnNBj2uoeI4EbYP4i6n68SG4I= github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexkohler/nakedret/v2 v2.0.4 h1:yZuKmjqGi0pSmjGpOC016LtPJysIL0WEUiaXW5SUnNg= github.com/alexkohler/nakedret/v2 v2.0.4/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bitfield/gotestdox v0.2.1 h1:Zj8IMLAO5/oiAKoMmtN96eyFiPZraJRTH2p0zDgtxc0= github.com/bitfield/gotestdox v0.2.1/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY= github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLdw= github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9MTI= github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/daixiang0/gci v0.13.4 h1:61UGkmpoAcxHM2hhNkZEf5SzwQtWJXTSws7jaPyqwlw= github.com/daixiang0/gci v0.13.4/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= github.com/elazarl/goproxy v1.2.1 h1:njjgvO6cRG9rIqN2ebkqy6cQz2Njkx7Fsfv/zIZqgug= github.com/elazarl/goproxy v1.2.1/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk= github.com/ghostiam/protogetter v0.3.6/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-critic/go-critic v0.11.4 h1:O7kGOCx0NDIni4czrkRIXTnit0mkyKOCePh3My6OyEU= github.com/go-critic/go-critic v0.11.4/go.mod h1:2QAdo4iuLik5S9YG0rT4wcZ8QxwHYkrr6/2MWAiv/vc= github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.13.0 h1:vLn5wlGIh/X78El6r3Jr+30W16Blk0CTcxTYcYPWi5E= github.com/go-git/go-git/v5 v5.13.0/go.mod h1:Wjo7/JyVKtQgUNdXYXIepzWfJQkUEIGvkvVkiXRR/zw= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.23.0 h1:/PwmTwZhS0dPkav3cdK9kV1FsAmrL8sThn8IHr/sO+o= github.com/go-playground/validator/v10 v10.23.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-task/task/v3 v3.38.0 h1:O7kgA6BfwktXHPrheByQO46p3teKtRuq1EpGnFxNzbo= github.com/go-task/task/v3 v3.38.0/go.mod h1:UzLDHoXTKNAtWwFP3WVsfMhlSw3K8i9KNzEO9kCHix8= github.com/go-task/template v0.0.0-20240602015157-960e6f576656 h1:knZZ4zVdTBQnevBz0zSES++4Mr7wr+cHopLvHabIgkA= github.com/go-task/template v0.0.0-20240602015157-960e6f576656/go.mod h1:RgwRaZK+kni/hJJ7/AaOE2lPQFPbAdji/DyhC6pxo4k= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= github.com/go-toolsmith/pkgload v1.2.2/go.mod h1:R2hxLNRKuAsiXCo2i5J6ZQPhnPMOVtU+f0arbFPWCus= github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= github.com/golangci/golangci-lint v1.60.3 h1:l38A5de24ZeDlcFF+EB7m3W5joPD99/hS5SIHJPyZa0= github.com/golangci/golangci-lint v1.60.3/go.mod h1:J4vOpcjzRI+lDL2DKNGBZVB3EQSBfCBCMpaydWLtJNo= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= github.com/golangci/modinfo v0.3.4/go.mod h1:wytF1M5xl9u0ij8YSvhkEVPP3M5Mc7XLl1pxH3B2aUM= github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= github.com/golangci/revgrep v0.5.3 h1:3tL7c1XBMtWHHqVpS5ChmiAAoe4PF/d5+ULzV9sLAzs= github.com/golangci/revgrep v0.5.3/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I= github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0= github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg= github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-zglob v0.0.4 h1:LQi2iOm0/fGgu80AioIJ/1j9w9Oh+9DZ39J4VAGzHQM= github.com/mattn/go-zglob v0.0.4/go.mod h1:MxxjyoXXnMxfIpxTK2GAkw1w8glPsQILx3N5wrKakiY= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbnVSxfHJk= github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs= github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/radovskyb/watcher v1.0.7 h1:AYePLih6dpmS32vlHfhCeli8127LzkIgwJGcwwe8tUE= github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm+ZuvsUYIg= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.3 h1:eiSQdJVNr9KTNxY2Niij8UReSwR8Xrte3exBrAZfqpg= github.com/ryancurrah/gomodguard v1.3.3/go.mod h1:rsKQjj4l3LXe8N344Ow7agAy5p9yjsWOtRzUMYmA0QY= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k= github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk= github.com/sajari/fuzzy v1.0.0 h1:+FmwVvJErsd0d0hAPlj4CxqxUtQY/fOoY0DwX4ykpRY= github.com/sajari/fuzzy v1.0.0/go.mod h1:OjYR6KxoWOe9+dOlXeiCJd4dIbED4Oo8wpS89o0pwOo= github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/securego/gosec/v2 v2.20.1-0.20240822074752-ab3f6c1c83a0 h1:VqD4JMoqwuuCz8GZlBDsIDyE6K4YUsWJpbNtuOWHoFk= github.com/securego/gosec/v2 v2.20.1-0.20240822074752-ab3f6c1c83a0/go.mod h1:iyeMMRw8QEmueUSZ2VqmkQMiDyDcobfPnG00CV/NWdE= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0= github.com/sivchari/tenv v1.10.0/go.mod h1:tdY24masnVoZFxYrHv/nD6Tc8FbkEtAQEEziXpyMgqY= github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/Gk8VQ= github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4= github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs= go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM= go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/gotestsum v1.11.0 h1:A88/QWw7acMjZH1dMe6KZFhw32odUOIjCiAU/Q4n3mI= gotest.tools/gotestsum v1.11.0/go.mod h1:cUOKgFEvWAP0twchmiOvdzX0SBZX0UI58bGRpRIu4xs= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/sh/v3 v3.8.0 h1:ZxuJipLZwr/HLbASonmXtcvvC9HXY9d2lXZHnKGjFc8= mvdan.cc/sh/v3 v3.8.0/go.mod h1:w04623xkgBVo7/IUK89E0g8hBykgEpN0vgOj3RJr6MY= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= ================================================ FILE: tools/main.go ================================================ package main import ( "os" "github.com/vektra/mockery/tools/cmd" ) func main() { if err := cmd.NewRootCmd().Execute(); err != nil { os.Exit(1) } } ================================================ FILE: tools/tools.go ================================================ //go:build tools package main import ( _ "github.com/go-task/task/v3/cmd/task" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "gotest.tools/gotestsum" _ "mvdan.cc/gofumpt" )