FAQ
Hi, I'm working on my first "real" project in go and I am stuck on a crazy
error.

For what I now know was a stupid reason I wanted my project to be in
/var/www/ because the other projects I'm working on are there so I used gopm
<https://github.com/gpmgo/gopm> to do that. My project was located in
/var/www/svnUp and everything worked fine. But today I concluded it was
silly of me to do that and decided to move it back to go path to location ~/go/src/nivas.hr/svnUp
and not to use gopm any more.

My project is structured in packages in various sub folders of svnUp since
I don't expect to share them across other projects:

nivas.hr/svnUp - main package

nivas.hr/svnUp/handlers/auth - auth package

nivas.hr/svnUp/handlers/gzip - gzip package

nivas.hr/svnUp/handlers/home - home package

nivas.hr/svnUp/library/webapp - webapp package

etc...


When running the app at one point I get this error:

gob: name not registered for interface: "_/var/www/svnUp/handlers/auth.SessionData"


As you see, the error mentions the old location of the project.


In package nivas.hr/svnUp/handlers/auth I have:

func init() {

     gob.Register(&SessionData{})

}

because I'm using Gorilla sessions package
<http://www.gorillatoolkit.org/pkg/sessions> and want to store a structure.
Gob and sessions are only used inside the auth package.

Following the Gorilla sessions package documentation custom naming is not provided when registering to gob.


I tried building with force option, tried "go clean", even removed go from the system and reinstalled it.

Nothing worked.


Any thoughts?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Tamás Gulácsi at Sep 25, 2014 at 8:24 pm
    rm $GOPATH/pkg

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Matej Baćo at Sep 25, 2014 at 9:19 pm
    Tried
    rm $GOPATH/pkg
    didn't work, still getting an error after build while running app.

    On Thursday, September 25, 2014 9:35:06 PM UTC+2, Matej Baćo wrote:

    Hi, I'm working on my first "real" project in go and I am stuck on a crazy
    error.

    For what I now know was a stupid reason I wanted my project to be in
    /var/www/ because the other projects I'm working on are there so I used
    gopm <https://github.com/gpmgo/gopm> to do that. My project was located
    in /var/www/svnUp and everything worked fine. But today I concluded it
    was silly of me to do that and decided to move it back to go path to
    location ~/go/src/nivas.hr/svnUp and not to use gopm any more.

    My project is structured in packages in various sub folders of svnUp since
    I don't expect to share them across other projects:

    nivas.hr/svnUp - main package

    nivas.hr/svnUp/handlers/auth - auth package

    nivas.hr/svnUp/handlers/gzip - gzip package

    nivas.hr/svnUp/handlers/home - home package

    nivas.hr/svnUp/library/webapp - webapp package

    etc...


    When running the app at one point I get this error:

    gob: name not registered for interface: "_/var/www/svnUp/handlers/auth.SessionData"


    As you see, the error mentions the old location of the project.


    In package nivas.hr/svnUp/handlers/auth I have:

    func init() {

    gob.Register(&SessionData{})

    }

    because I'm using Gorilla sessions package
    <http://www.gorillatoolkit.org/pkg/sessions> and want to store a
    structure. Gob and sessions are only used inside the auth package.

    Following the Gorilla sessions package documentation custom naming is not provided when registering to gob.


    I tried building with force option, tried "go clean", even removed go from the system and reinstalled it.

    Nothing worked.


    Any thoughts?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ingo Oeser at Sep 27, 2014 at 8:18 am
    Use gob.RegisterName() too. See http://godoc.org/encoding/gob#RegisterName

    So you can supply the old name for migration and support the new name (derived automatically by gob.Register() for writing the sessions.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 25, '14 at 7:35p
activeSep 27, '14 at 8:18a
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase