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.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
When Platform Engineering Meets GenAI
sucitw
0
140
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
420
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
9
1.4k
クラウドファンディング版StackChan 3体(4体)をインタラクティブな体験型作品にして展示もした話 / スタックチャンお誕生日会2026
you
PRO
0
130
マルチアカウント環境での コーディングエージェントを使った障害調査が大変なので AIエージェントにReadOnly権限を付与してみた / ReadOnly AI Agents for Multi-Account AWS Incident Response
yamaguchitk333
2
120
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
190
【Snowflake Summit 2026 Recap!!】Snowflake Summit Deep Dive: Security & Governance
civitaspo
1
280
AWS Security Agent といっしょに脅威モデリングをやってみよう
amarelo_n24
1
190
水を運ぶ人としてのリーダーシップ
izumii19
2
220
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
10
2.1k
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
310
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
420
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Automating Front-end Workflow
addyosmani
1370
210k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
260
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Un-Boring Meetings
codingconduct
0
320
Prompt Engineering for Job Search
mfonobong
0
350
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
270
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
240
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
430
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