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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
美味しいスイスチーズを作ろう🧀🐭
taigamikami
1
230
Gradle×GitHub_ActionsでCI時間を約50%短縮 ジョブ分割の設計と落とし穴 / Cutting CI Time by ~50% with Gradle and GitHub Actions: Job-Splitting Design and Pitfalls
takatty
0
620
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
160
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
1k
Sony_KMP_Journey_KotlinConf2026
sony
2
210
ITエンジニアを取り巻く環境とキャリアパス / A career path for Japanese IT engineers
takatama
4
1.8k
Javaで学ぶSOLID原則
negima
1
270
生成 AI × MCP で切り拓く次世代 SRE!自律型運用への挑戦と開発者体験の進化
_awache
0
110
「嘘をつくテスト」の失敗例から学ぶ 良いテストコード #frontend_phpcon_do
asumikam
0
160
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
0
350
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
130
oracle-to-databricks-migration-with-llm-and-dbt
casek
1
430
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Are puppies a ranking factor?
jonoalderson
1
3.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
400
Automating Front-end Workflow
addyosmani
1370
210k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
A designer walks into a library…
pauljervisheath
211
24k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
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