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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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.5k
ripgrep をライブラリとして使う
rhysd
0
740
port-monolith-to-wasm-for-chrome-extension
rhysd
0
550
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
5k
Other Decks in Technology
See All in Technology
【Cyber-sec+】経営層を"動かす"ための考え方
hssh2_bin
0
200
データサイエンスを価値につなげるプロジェクト設計 〜 DS一年目が現場で得た気づき 〜
ysd113
1
290
[チョークトーク資料]AWS DevOps Agent を使いこなす / AWS Dev Ops Agent Chalk Talk AWS Summit Japan 2026
kinunori
3
640
Chainlitで作るお手軽チャットUI
ynt0485
0
280
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
190
気軽に使える"情報のハブ"としてのNotion活用 〜フロー情報の集積点 と、 Claude Code × Notion AI〜
syucream
1
160
2026年6月23日 Syncable Tech + Start Python Club にて
hamukazu
0
140
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
320
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
140
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
110
[AWS Summit Japan 2026]迷っているあなたへ_小さな一歩が、やがて自分を助けてくれる
sh_fk2
1
210
自宅LLMの話
jacopen
1
690
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
200
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
430
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
From π to Pie charts
rasagy
0
220
Facilitating Awesome Meetings
lara
57
7k
Evolving SEO for Evolving Search Engines
ryanjones
0
220
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
How STYLIGHT went responsive
nonsquared
100
6.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
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