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

CookieStorer, SessionStorer invalid types for CookieState, SessionState #33

Closed
drshrey opened this issue Dec 24, 2019 · 1 comment
Closed

Comments

@drshrey
Copy link

drshrey commented Dec 24, 2019

Hey there, my code is failing when I use the pattern provided in https://github.com/volatiletech/authboss-sample/blob/master/blog.go#L66. Here's what my code looks like:

import (
	"github.com/volatiletech/authboss"
	abclientstate "github.com/volatiletech/authboss-clientstate"

)

var sessionStore abclientstate.SessionStorer
var cookieStore abclientstate.CookieStorer

authBoss.Config.Storage.CookieState = cookieStore
authBoss.Config.Storage.SessionState = sessionStore

This is the error:

./main.go:91:38: cannot use cookieStore (type abclientstate.CookieStorer) as type "github.com/drshrey/scobophile/scobophile-go-api/vendor/github.com/volatiletech/authboss".ClientStateReadWriter in assignment:
        abclientstate.CookieStorer does not implement "github.com/drshrey/scobophile/scobophile-go-api/vendor/github.com/volatiletech/authboss".ClientStateReadWriter (wrong type for ReadState method)
                have ReadState(*http.Request) ("github.com/volatiletech/authboss".ClientState, error)
                want ReadState(*http.Request) ("github.com/drshrey/scobophile/scobophile-go-api/vendor/github.com/volatiletech/authboss".ClientState, error)
./main.go:92:39: cannot use sessionStore (type abclientstate.SessionStorer) as type "github.com/drshrey/scobophile/scobophile-go-api/vendor/github.com/volatiletech/authboss".ClientStateReadWriter in assignment:
        abclientstate.SessionStorer does not implement "github.com/drshrey/scobophile/scobophile-go-api/vendor/github.com/volatiletech/authboss".ClientStateReadWriter (wrong type for ReadState method)
                have ReadState(*http.Request) ("github.com/volatiletech/authboss".ClientState, error)
                want ReadState(*http.Request) ("github.com/drshrey/scobophile/scobophile-go-api/vendor/github.com/volatiletech/authboss".ClientState, error)

Versions of both packages:

[[constraint]]
  name = "github.com/volatiletech/authboss"
  version = "2.3.0"

[[constraint]]
  branch = "master"
  name = "github.com/volatiletech/authboss-clientstate"

Any reason why the types don't match? I checked out the definitions and they do seem to implement the ClientStateReadWriter interface, so help here would be much appreciated!

@drshrey
Copy link
Author

drshrey commented Dec 24, 2019

Nevermind, I was able to fix it by doing dep ensure -add github.com/volatiletech/authboss-clientstate. Before, it was including the the clientstate lib from my /go/src/... path. Not sure why a go get -u on the package would be different from dep ensure, but that seems to have fixed it. Closing this!

@drshrey drshrey closed this as completed Dec 24, 2019
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

1 participant