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
OSS貢献を気軽にしたい Let's Go Talk #1
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
aboy
July 06, 2022
Programming
2
650
OSS貢献を気軽にしたい Let's Go Talk #1
Let's Go Talk #1でのLT資料です
aboy
July 06, 2022
Tweet
Share
More Decks by aboy
See All by aboy
生成AIで日々のエラー調査を進めたい
yuyaabo
0
970
みんなでエラー監視するSRE夕会の効果_ゆるSRE勉強会1
yuyaabo
1
710
Go 1.19.1 security fix net/url JoinPath
yuyaabo
1
540
HTTPステータスコードが意図した値にならないとき Let's Go Talk #2
yuyaabo
1
550
困ったときが学びどき.pdf
yuyaabo
0
650
Build dynamic iOS apps with the Create ML framework の要約
yuyaabo
0
1.2k
fastlaneベースでTravis CIからBitriseに移行しました
yuyaabo
0
1.8k
Mixpanelのすゝめ
yuyaabo
0
3k
Use model deployment and security with Core MLの要約
yuyaabo
2
610
Other Decks in Programming
See All in Programming
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
290
20260315 AWSなんもわからん🥲
chiilog
2
150
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
190
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
110
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
560
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
140
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
140
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.3k
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
550
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
120
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
1k
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
730
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
270
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
Building an army of robots
kneath
306
46k
Done Done
chrislema
186
16k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
110
30 Presentation Tips
portentint
PRO
1
250
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Transcript
OSS貢献を気軽にしたい 2022/07/06 Let’s Go Talk #1 5分LT
自己紹介 - aboyです - コネヒト株式会社 - 最近はママリの検索を最高にする仕事をしてます - あと最近GoをさわっていてTech VisionのGo戦略を推進中
モチベーション - 普段お世話になっているOSSに貢献したい - Goさわりたてなので簡単なことから始めたい
Go Report Cardっていうのがあるぞ - https://goreportcard.com/ - Go製プロジェクトのREADMEによくあるこのバッヂ - 指定したプロジェクトに静的解析をかけてスコア化してくれる
Go Report Cardを使ってOSS貢献を始める - gocycloとlicense以外は、どう修正したらいいかがわかりやすい - Go初学者でもPRを送りやすい - misspellだって、あってもいいことは何も無いので、立派な貢献 -
少なくとも見つけたらそのままにしない gorilla/schemaのmisspellの例
👏 ※ gorillaのメンテナ事情(切実)https://github.com/gorilla/mux/issues/659
他の人の背中も押したいぞ - OSS貢献したいけど、ハードルや面倒さを感じてる人の背中を押したい - 入口がmisspellの修正でも、成功体験からさらにGoに興味を持ってくれると嬉しい - 自分たちがお世話になっているOSSへ貢献するという行動を当たり前にできると嬉しい - 仕組み化したい -
ある程度は仕組み化して自動化や横展開できると嬉しい
ツールをつくった(ってる) - https://github.com/YuyaAbo/gontribute - Go Report CardはCLIが提供されてる - https://github.com/gojp/goreportcard/tree/master/cmd/goreportcard-cli -
自分たちのプロジェクトのgo.modに書かれているrequireに対してCLIを適用 すればやりたいことできそう
デモ
実装 1. GitHub APIをつかって指定リポジトリのgo.modを取得する 2. go.modをパースする(後述) 3. requireに対してGitHub APIをつかってアーカイブリンクを取得する 4.
アーカイブリンクからzipをダウンロードする 5. zipを展開 6. 展開先のディレクトリでGo Report Card CLIを実行 7. 展開したディレクトリを削除 8. 3~7を繰り返す
go.modのパース - 準標準パッケージmod/modfileで可能 - https://pkg.go.dev/golang.org/x/mod/modfile fc, _, _, err :=
client.Repositories.GetContents(ctx, owner, repo, "go.mod", nil) if err != nil { log.Fatalln(err) } s, err := fc.GetContent() if err != nil { log.Fatalln(err) } f, err := modfile.Parse("go.mod", []byte(s), nil) if err != nil { log.Fatalln(err) }
あとは愚直オブ愚直 - exec.Commandでコマンド実行 - ↓こんな感じ b, err := exec.Command("zipinfo", "-1",
zipFileName).Output() if err != nil { log.Println(err) return } dirName := strings.Split(string(b), "/")[0] if err = exec.Command("unzip", "-o", zipFileName).Run(); err != nil { log.Println(err) return }
まとめ - 自分たちが使っているOSSに気軽に貢献したい、する人を増やしたい - Go Report Cardを使えば比較的簡単な貢献チャンスに気づける - Go Report
Card CLIを使って仕組み化するようなツールを作ってみた - 引き続きいい感じに作っていくぞ!
fin