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

compile error: impossible type assertion #787

Open
mzychaco opened this issue Dec 13, 2022 · 2 comments
Open

compile error: impossible type assertion #787

mzychaco opened this issue Dec 13, 2022 · 2 comments

Comments

@mzychaco
Copy link

I got an error while I tring to compile my project with machinery/v1
Here is the log:


external/com_google_cloud_go_pubsub/message.go:42:42: impossible type assertion:
        *psAckHandler does not implement "cloud.google.com/go/internal/pubsub".AckHandler (missing OnAckWithResult method)
external/com_google_cloud_go_pubsub/message.go:70:27: cannot use ackh (type *psAckHandler) as type "cloud.google.com/go/internal/pubsub".AckHandler in argument to "cloud.google.com/go/internal/pubsub".NewMessage:
        *psAckHandler does not implement "cloud.google.com/go/internal/pubsub".AckHandler (missing OnAckWithResult method)
compilepkg: error running subcommand external/go_sdk/pkg/tool/linux_amd64/compile: exit status 2
Target //workflow/cmd:workflow failed to build

And then, I found that Machinery depends on cloud.google.com/go@v0.76.0, but my project depends on v0.105.0.
The different between this two version is about a interface in cloud.google.com/go/internal/pubsub/message.go

type AckHandler interface {

        // both declare in  v0.76.0 and v0.105.0
	OnAck() 
	OnNack()

        // only declare in v0.105.0
	OnAckWithResult() *AckResult
	OnNackWithResult() *AckResult
}

What should I do with this error? Beg for reply, thanks a lot

@kabelsea
Copy link

you can replace broken dependency on go mod ... project has not been updated for a long time

replace (
	cloud.google.com/go/pubsub => cloud.google.com/go/pubsub v1.9.0 // bug on machinery
)

@mrz1836
Copy link

mrz1836 commented Feb 2, 2023

Thanks @kabelsea that fixed my issue as well using that package in GoLand IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants