Closed krsanky closed 5 years ago
Are you using modules for the dependencies in your project, or the traditional GOPATH approach?
I am using the traditional GOPATH approach. (I am investigating using modules after you asked, in case that's what I should do going fwd)
For running it under your GOPATH
:
v2
postfix: go get github.com/alexedwards/scs
v2
postfix: import "github.com/alexedwards/scs"
Everything else should work as normal as documented after that.
But yes, I definitely recommend switching to using modules. There's a great introduction here.
I'll update the installation instructions in the README to make this clearer.
Thanks for the help.
For posterity: My underlying issue was that the scs api had simply changed in between me working on it. I needed to update my code from the Manager.Load interface to using the simpler Session one. Ironically this is something that the go modules approach would mitigate going forward, because you are more deliberate about versions when importing go code. thanks again
Thanks for the explanation and sorry for any trouble. It sounds like it was just unfortunate timing! The API should be stable now for a long time, and you're right, modules will address exact this problem in the future anyway.
go get github.com/alexedwards/scs/v2 package github.com/alexedwards/scs/v2: cannot find package "github.com/alexedwards/scs/v2" in any of: /usr/local/go/src/github.com/alexedwards/scs/v2 (from $GOROOT) /home/wise/go/src/github.com/alexedwards/scs/v2 (from $GOPATH)
I'm moving a site I have in development to a new machine. I have the site working on another machine, I last set that one up maybe a week ago.
What's the easiest way to use scs and postgresql?