sanbornm/go-selfupdate

Does it still work?

krzysztofantczak opened this issue · 6 comments

Hi,

Does this module still work? I'm kind of new to GO but no idea if i'm doing something wrong or module doesn't work anymore, i'm using your exact code from readme and i'm getting:

$ go run test.go
# github.com/sanbornm/go-selfupdate/selfupdate
../../../github.com/sanbornm/go-selfupdate/selfupdate/selfupdate.go:79: undefined: update.SanityCheck
../../../github.com/sanbornm/go-selfupdate/selfupdate/selfupdate.go:144: undefined: update.FromStream

It does but it requires specific versions of some dependencies. Please install godep and try:

godep go run test.go

ok, so from scratch in new test project:

$ go get github.com/sanbornm/go-selfupdate/selfupdate
$ godep save ./...
$ godep go run test.go
# github.com/sanbornm/go-selfupdate/selfupdate
Godeps/_workspace/src/github.com/sanbornm/go-selfupdate/selfupdate/selfupdate.go:79: undefined: update.SanityCheck
Godeps/_workspace/src/github.com/sanbornm/go-selfupdate/selfupdate/selfupdate.go:144: undefined: update.FromStream
godep: go exit status 2

source code:

package main

import "github.com/sanbornm/go-selfupdate/selfupdate"

func main () {

    var updater = &selfupdate.Updater{
    CurrentVersion: version,
        ApiURL:         "http://updates.yourdomain.com/",
        BinURL:         "http://updates.yourdownmain.com/",
        DiffURL:        "http://updates.yourdomain.com/",
        Dir:            "update/",
        CmdName:        "myapp", // app name
    }

    if updater != nil {
        go updater.BackgroundRun()
    }
}

Hmm, it seems that Godeps/Godeps.json contains different version of packages than in Your list, i've tried to nuke all of those packages cleanup my project and godep get them again with same result.

So I may not understand Godep 100%. It appears that it really doesn't work for importing libraries. It may only work when building a project.

See: tools/godep#109 (comment)

If this is true, you may need to look in this projects Godep.json and add some of those to your project as well. Does that make sense?

Why are you not using the latest version of go-update?

And yeah, you need to actually have the code in this repo if not building through godep..
Godep is mostly usable from a main() perspective.

Seems like someone already migrated the version (?)

The commit is a bit noisy to read because it implements the change and gofmt is run a well.

canerdogan@c2f128a

Why are you not using the latest version of go-update?

No reason, I just pulled the update from canerdogan/go-selfupdate@c2f128a

Thanks for reporting