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 1.24 のイテレータ from byte to bite
Search
Nozomu Ikuta
February 25, 2025
Technology
110
0
Share
Go 1.24 のイテレータ from byte to bite
CA.go ~ Deep dive into Go1.24 ~ の登壇資料です
Nozomu Ikuta
February 25, 2025
More Decks by Nozomu Ikuta
See All by Nozomu Ikuta
Standard Schema: スキーマライブラリの統一企画とは何か
nozomuikuta
1
2.3k
Demystifying Vite Internals
nozomuikuta
3
2.9k
Nuxt DevTools 101
nozomuikuta
3
2.2k
Deep Dive to UnJS and Nuxt 3
nozomuikuta
3
3.1k
OSS作者はじめの一歩
nozomuikuta
1
250
2022 年は Docus に注目しよう
nozomuikuta
1
140
Go初学者、最初の1週間の学び
nozomuikuta
1
130
Other Decks in Technology
See All in Technology
製造業のクラウド活用最適解〜AI,DXを加速するデータ基盤の作り方〜
hamadakoji
0
320
速さだけじゃない! VoidZero ツールが移行先に選ばれる理由
mizdra
PRO
6
730
Unlocking the Apps
pimterry
0
180
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
690
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
330
Claude Codeを組織で使いこなす— サーバサイドAIエージェント運用の実践知
techtekt
PRO
0
190
生成 AI × MCP で切り拓く次世代 SRE!自律型運用への挑戦と開発者体験の進化
_awache
0
100
noUncheckedIndexedAccess、3時間、1万円。 / noUncheckedIndexedAccess, 3 Hours, 10,000 JPY.
kaonavi
1
140
AIを「創る」と「使う」の循環 — HRテックが実践するリアルなAI組織実装
taketo957
0
1.1k
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
0
350
プラットフォームエンジニア ワークショップ/ platform-workshop
databricksjapan
0
220
「速く作る」から「正しく作る」へ ─ 生成AI時代の開発フロー改革の ロードマップと実行 ─
starfish719
0
5.8k
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Balancing Empowerment & Direction
lara
6
1.1k
Evolving SEO for Evolving Search Engines
ryanjones
0
210
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
720
My Coaching Mixtape
mlcsv
0
140
Transcript
Nozomu Ikuta 25th Feb. 2025 Go 1.24 ͷΠςϨʔλ from byte
to bite
@nozomuikuta X / GitHub • ιϑτΣΞΤϯδχΞ • Vue.js ຊϢʔβʔάϧʔϓίΞελοϑ •
UnJS ϝϯόʔ • Nuxt / Vite ίϯτϦϏϡʔλ
ϩΰืूத Shibuya.go
• ΠςϨʔλ͓͞Β͍ • bytes ύοέʔδͷΠςϨʔλ
ΠςϨʔλ͓͞Β͍
ΠςϨʔλ͓͞Β͍ • Go 1.23 ͰՃ͞Εͨ • yield ʹΑͬͯ࿈ଓͨ͠ΛίʔϧόοΫؔʹΘͨؔ͢ͷ͜ͱ • ͕ͳ͘ͳΔ͔
yield ͕ false Λฦ͢ͱΠςϨʔγϣϯ͕ऴྃ͢Δ
ΠςϨʔλ͓͞Β͍ • ͻͱͭͷΛΘͨ͢: Seq[V any] func(yield func(V) bool) • slices.All()
• slices.Values() • slices.Backward() • slices.Sorted() • etc.
ΠςϨʔλ͓͞Β͍ • ;ͨͭͷΛΘͨ͢: Seq2[K, V any] func(yield func(K, V) bool)
• maps.All() • maps.Insert() • etc.
bytes ύοέʔδͷΠςϨʔλ
• bytes.Lines() • bytes.FieldsSeq() • bytes.SplitSeq() • bytes.SplitAfterSeq() • bytes.FieldsFuncSeq()
bytes ύοέʔδͷΠςϨʔλ طఆͰׂ / ࣗ༝Ͱׂ
func Lines(s []byte) iter.Seq[[]byte] • newlineʢվߦʣͷޙͰ byte Λ۠ ͬͯฦͯ͘͠ΕΔ •
֤ඌʹվߦ͕͍ͭͯ͘Δ • byte ඌͷվߦͷ༗ແଚॏ͞Ε Δ bytes ύοέʔδͷΠςϨʔλ
func FieldsSeq(s []byte) iter.Seq[[]byte] • unicode.IsSpace()ʢۭനʣʹ߹க͢ Δ෦Ͱ byte Λ۠ͬͯฦͯ͘͠ ΕΔ
• ֤લޙʹۭനΛ;͘·ͳ͍ bytes ύοέʔδͷΠςϨʔλ
func SplitSeq(s, sep []byte) iter.Seq[[]byte] • ҙͷ byte slice Ͱ۠ͬͯฦͯ͠
͘ΕΔ • ֤ඌʹ۠Γ෦Λ;͘·ͳ͍ bytes ύοέʔδͷΠςϨʔλ
func SplitAfterSeq(s, sep []byte) iter.Seq[[]byte] • ҙͷ byte slice Ͱ۠ͬͯฦͯ͠
͘ΕΔ • ֤ඌʹ۠Γ෦Λ;͘Ή bytes ύοέʔδͷΠςϨʔλ
• ҙͷؔͰ byte Λ۠ͬͯฦ͠ ͯ͘ΕΔ • unicode.IsX() ϝιουͳͲͱΈ߹ Θͤͯ͏ •
֤લޙʹ۠Γ෦Λ;͘·ͳ ͍ bytes ύοέʔδͷΠςϨʔλ func FieldsFuncSeq(s []byte, f func(rune) bool) iter.Seq[[]byte]
·ͱΊ
• bytes ύοέʔδʹΠςϨʔλ͕ಋ ೖ͞Εͨ • ʮ۠ͬͯϧʔϓʯ͕ΑΓศརʹ
ࢀߟจݙ • https://go.dev/doc/go1.24 • https://pkg.go.dev/iter • https://pkg.go.dev/bytes
Thank you