Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
go-selfupdate-github で ツールを自己アップデートする
Search
Linda_pp
April 15, 2018
Technology
4.6k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
go-selfupdate-github で ツールを自己アップデートする
GoCon 2018 Spring LT
Linda_pp
April 15, 2018
More Decks by Linda_pp
See All by Linda_pp
actionlint の Linter 設計
rhysd
7
6.6k
ripgrep をライブラリとして使う
rhysd
0
750
port-monolith-to-wasm-for-chrome-extension
rhysd
0
560
Fuzzing Rust Text Editor
rhysd
1
3.1k
Vim compiled to WebAssembly
rhysd
5
2.4k
about-neovim-0.4.0-floating-window
rhysd
3
2.4k
reply.vim
rhysd
0
1.4k
Vim ported to WebAssembly (VimConf 2018)
rhysd
4
3.6k
小さく始めて育てるコンパイラ
rhysd
13
5.1k
Other Decks in Technology
See All in Technology
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
1.1k
AICoEでAIネイティブ組織への進化
yukiogawa
0
210
AI工学特論: MLOps・継続的評価
asei
4
1.1k
“それは自分の仕事じゃない"を越えて行け
yuukiyo
1
520
データエンジニアリングとドメイン駆動設計
masuda220
PRO
14
2.5k
OPENLOGI Company Profile for engineer
hr01
1
74k
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
170
Playwright × AI Agent でE2Eテストはどう変わるか AI駆動テストの可能性と実用検証の結果
taiga7543
2
790
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
1
280
探索・可視化・自動化を一本化 Amazon Quickでデータ活用スピードを上げる方法
koheiyoshikawa
0
170
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
1
740
書籍セキュアAPIについて
riiimparm
0
230
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
360
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Fireside Chat
paigeccino
42
4k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
430
Odyssey Design
rkendrick25
PRO
2
730
Are puppies a ranking factor?
jonoalderson
1
3.7k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
410
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.7k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
A Soul's Torment
seathinner
6
3.1k
Transcript
go-selfupdate-github Ͱ πʔϧΛࣗݾΞοϓσʔτ͢Δ Go Con 2018 Spring LT @Linda_pp @rhysd
GoͷCLIπʔϧͷΞοϓσʔτͲ ͏ͯ͠·͔͢ʁ • go get -u • γεςϜͷύοέʔδϚωʔδϟʢbrew ͳ ͲʣΛ͏
• GitHub ͷϦϦʔεϖʔδ͔Β࠷৽൛Λμϯ ϩʔυ͢Δ
go get -u • ϦϦʔε͢Δඞཁͳָͯ͘ʢϝϯςφʣ • ৗʹϦϙδτϦͷ HEAD ΛϏϧυ͢ΔͷͰ unstableʢϢʔβʣ
• Go ͷ։ൃڥͷΠϯετʔϧ͕ඞཁʢϢʔ βʣ
γεςϜͷύοέʔδϚωʔδϟ ʢbrewͳͲʣΛ͏ • ࠷৽ͷ stable ൛ΛָʹೖΕΒΕΔʢϢʔβʣ • OSʹΑͬͯΓํ͕ҧ͏ʢϢʔβ&ϝϯς φʣ •
ύοέʔδొ͕େมʢϝϯςφʣ
GitHub ͷϦϦʔεϖʔδ͔Β࠷ ৽൛Λμϯϩʔυ͢Δ • ࠷৽ͷ stable ൛ΛೖΕΒΕΔʢϢʔβʣ • gox
ghr ͳͲͰ؆୯ϦϦʔεʢϝϯςφʣ • खͰμϯϩʔυͯ͘͠Δͷ͕໘ʢϢʔβʣ
ͲΕҰҰ
GitHub ͷϦϦʔεϖʔδ͔Β࠷ ৽൛Λμϯϩʔυ͢Δ • ࠷৽ͷ stable ൛ΛೖΕΒΕΔʢϢʔβʣ • gox
ghr ͳͲͰ؆୯ϦϦʔεʢϝϯςφʣ • खͰμϯϩʔυͯ͘͠Δͷ͕໘ʢϢʔβʣ • खͰμϯϩʔυͯ͘͠Δͷ͕໘ʢϢʔβʣ ࣗಈԽͰ͖ΔͷͰʁ
go-github-selfupdate όΠφϦΛࣗݾΞοϓσʔτ͢ΔΈΛఏڙ ͢ΔϥΠϒϥϦ https://github.com/rhysd/go-github-selfupdate
go-github-selfupdate • GitHub ͷϦϦʔεϖʔδ͔Β࠷৽൛ͷόΠφ ϦΛࣗಈݕग़ʢsemver Λఆʣ • ϦϦʔεϖʔδ͔ΒόΠφϦΛࣗಈμϯϩʔ υʢ+ղౚʣ •
࣮ߦϑΝΠϧΛࣗಈஔ͖͑
import ( "log" "github.com/blang/semver" "github.com/rhysd/go-github-selfupdate/selfupdate" ) const current = "1.2.3"
func doSelfUpdate() { v := semver.MustParse(current) latest, err := selfupdate.UpdateSelf(v, "myname/myrepo") if err != nil { log.Panicln("Binary update failed:", err) } if latest.Version.Equals(v) { log.Println("Current binary is the latest", current) } else { log.Println( "Updated to", latest.Version, "Release note:\n", latest.ReleaseNotes, ) } }
GitHub ͷϦϦʔεϖʔδ + go-github-selfupdate • ࠷৽ͷ stable ൛ΛೖΕΒΕΔʢϢʔβʣ • gox
ghr ͳͲͰ؆୯ϦϦʔεʢϝϯςφʣ • खͰμϯϩʔυͯ͘͠Δͷ͕໘ʢϢʔβʣ • ίϚϯυҰൃͰࣗಈΞοϓσʔτʢϢʔβʣ
go-github-selfupdate ৄࡉ • ✔ Linux, Windows, macOS Ͱ CI •
✔ ϓϥΠϕʔτϦϙδτϦରԠ • ✔ GitHub Enterprise ରԠ • ✔ ࣮ߦϑΝΠϧஔ͖ࣦ͑ഊ࣌ͷϩʔϧόοΫ • ✔ ѹॖܗࣜɿzip, tar, gzip, xzip
ࢀߟϦϯΫ • ϦϙδτϦ: • https://github.com/rhysd/go-github-selfupdate • υΩϡϝϯτ: • https://godoc.org/github.com/rhysd/go-github-selfupdate/ selfupdate
• ϥούʔϥΠϒϥϦ: • https://github.com/Songmu/ghselfupdate • ϒϩάهࣄ: • https://rhysd.hatenablog.com/entry/2017/12/30/220214 @Linda_pp @rhysd CZ