FAQ
Announcing a golang package to check a provided version is latest remote
source

https://github.com/tcnksm/go-latest

You can use it in your tool and tell user that latest version is released
or not after distribution.
If you build a tool by Golang and distribute it as binary format, this
helps you to encourage your user to update latest version of it.
For remote source to check version, you can use GitHub tags, HTML meta tag,
JSON API.

Usage is simple, for example, if you want to check version usgin Github tag,

```

githubTag := &latest.GithubTag{
     Owner: "username",
     Repository: "reponame",
}

res, _ := latest.Check(githubTag, "0.1.0")
if res.Outdated {
     fmt.Printf("0.1.0 is not latest, you should upgrade to %s", res.Current)
}

```

If you have question or comment, please contact me.

Thanks,

--
Taichi Nakashima (https://github.com/tcnksm)

--
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 Apr 13, 2015 at 11:17 am
    Have you seen github.com/rjeczalik/bin ?

    --
    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.
  • Taichi nakashima at Apr 16, 2015 at 8:54 am
    Oh I didn't know this, thanks,

    But go-latest can be embedded in your tool (binary) and tell user to update
    it when they execute it.


    2015年4月13日月曜日 20時17分54秒 UTC+9 Tamás Gulácsi:
    Have you seen github.com/rjeczalik/bin ?
    --
    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
postedApr 13, '15 at 8:48a
activeApr 16, '15 at 8:54a
posts3
users2
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase