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
760
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
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
220
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
300
関東Kaggler会発表資料
takoi
1
220
侵入は突然に 〜 IoTマルウェアと悪用される家庭の機器 ~ / When Intrusion Strikes: IoT Malware and the Abuse of Home Devices
nttcom
0
1.6k
Agent 時代の Kaggle 展望 / kaggle-in-the-agentic-era
upura
1
720
モダンフロントエンド 開発研修
recruitengineers
PRO
4
630
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
120
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
260
まちスペース®とデジタルツインと「まちづくり」
hiro_ogi
0
110
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
200
Digitization部 紹介資料
sansan33
PRO
2
7.7k
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
9k
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
750
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
Prompt Engineering for Job Search
mfonobong
0
400
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
430
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
370
The Cost Of JavaScript in 2023
addyosmani
55
10k
Utilizing Notion as your number one productivity tool
mfonobong
4
540
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
640
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
200
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
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