Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error when generating mocks #414

Merged
merged 1 commit into from
Nov 11, 2022
Merged

fix: error when generating mocks #414

merged 1 commit into from
Nov 11, 2022

Conversation

apricote
Copy link
Member

While generating mocks for new methods from hcloud-go 1.37.0 we encountered following error log when running go generate:

prog.go:12:2: no required module provides package github.com/golang/mock/mockgen/model: go.mod file not found in current directory or any parent directory; see 'go help modules'
prog.go:14:2: no required module provides package github.com/hetznercloud/cli/internal/hcapi2: go.mod file not found in current directory or any parent directory; see 'go help modules'
2022/11/10 14:52:03 Loading input failed: exit status 1
internal/hcapi2/mock_gen.go:3: running "mockgen": exit status 1

This was solved by moving the mocks into a seperate package.

While generating mocks for new methods from hcloud-go 1.37.0 we encountered
following error log when running `go generate`:

    prog.go:12:2: no required module provides package github.com/golang/mock/mockgen/model: go.mod file not found in current directory or any parent directory; see 'go help modules'
    prog.go:14:2: no required module provides package github.com/hetznercloud/cli/internal/hcapi2: go.mod file not found in current directory or any parent directory; see 'go help modules'
    2022/11/10 14:52:03 Loading input failed: exit status 1
    internal/hcapi2/mock_gen.go:3: running "mockgen": exit status 1

This was solved by moving the mocks into a seperate package.
@apricote apricote merged commit edb0bdf into main Nov 11, 2022
@apricote apricote deleted the fix-mock-generation branch November 11, 2022 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants