gofr-dev / gofr

An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability.
https://gofr.dev
Apache License 2.0
3.02k stars 203 forks source link

pub/sub error in new verision of gofr #128

Closed saksham5701 closed 9 months ago

saksham5701 commented 9 months ago

I was running the example/sample-API of gofr repo.While i run the main file i got the error that says

"# gofr.dev/pkg/datastore/pubsub/eventhub ....\go\pkg\mod\gofr.dev@v1.0.3\pkg\datastore\pubsub\eventhub\eventhub.go:70:60: cannot use tokenProvider (variable of type "github.com/Azure/azure-amqp-common-go/v3/sas".TokenProvider) as "github.com/Azure/azure-amqp-common-go/v4/auth".TokenProvider value in argument to eventhub.NewHub: "github.com/Azure/azure-amqp-common-go/v3/sas".TokenProvider does not implement "github.com/Azure/azure-amqp-common-go/v4/auth".TokenProvider (wrong type for method GetToken) have GetToken(string) ("github.com/Azure/azure-amqp-common-go/v3/auth".Token, error) want GetToken(string) ("github.com/Azure/azure-amqp-common-go/v4/auth".Token, error) ....\go\pkg\mod\gofr.dev@v1.0.3\pkg\datastore\pubsub\eventhub\eventhub.go:83:59: cannot use jwtProvider (variable of type "github.com/Azure/azure-amqp-common-go/v3/aad".TokenProvider) as "github.com/Azure/azure-amqp-common-go/v4/auth".TokenProvider value in argument to eventhub.NewHub: "github.com/Azure/azure-amqp-common-go/v3/aad".TokenProvider does not implement "github.com/Azure/azure-amqp-common-go/v4/auth".TokenProvider (wrong type for method GetToken) have GetToken(string) ("github.com/Azure/azure-amqp-common-go/v3/auth".Token, error) want GetToken(string) ("github.com/Azure/azure-amqp-common-go/v4/auth".Token, error)"

Although i downgraded the version after which this error vanished.I even tried go mod tidy but still i got this error.After downgrading i got this error

"# gofr.dev/pkg/datastore ....\go\pkg\mod\gofr.dev@v1.0.0\pkg\datastore\db.go:361:45: cannot use semconv.DBSystemPostgreSQL.Value.AsString() (value of type string) as otelsql.Option value in argument to otelsql.Register: string does not implement otelsql.Option (missing method Apply) ....\go\pkg\mod\gofr.dev@v1.0.0\pkg\datastore\db.go:363:45: cannot use dialect (variable of type string) as otelsql.Option value in argument to otelsql.Register: string does not implement otelsql.Option (missing method Apply)"

I have uploaded whole codebase that i wrote athttps://github.com/saksham5701/mini-pro-gofr-zopsmart

aryanmehrotra commented 9 months ago

Hey, there is an issue with your go.mod file, could you try to delete and initialise it again, followed by go mod tidy. Moreover, I have created a PR with fixed go.mod file. https://github.com/saksham5701/mini-pro-gofr-zopsmart/pull/2

saksham5701 commented 9 months ago

Thanks for your help. The program is running fine now.