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
0
100
Go 1.24 のイテレータ from byte to bite
CA.go ~ Deep dive into Go1.24 ~ の登壇資料です
Nozomu Ikuta
February 25, 2025
Tweet
Share
More Decks by Nozomu Ikuta
See All by Nozomu Ikuta
Standard Schema: スキーマライブラリの統一企画とは何か
nozomuikuta
1
2.2k
Demystifying Vite Internals
nozomuikuta
3
2.7k
Nuxt DevTools 101
nozomuikuta
3
2.1k
Deep Dive to UnJS and Nuxt 3
nozomuikuta
3
2.9k
OSS作者はじめの一歩
nozomuikuta
1
230
2022 年は Docus に注目しよう
nozomuikuta
1
120
Go初学者、最初の1週間の学び
nozomuikuta
1
110
Other Decks in Technology
See All in Technology
AWS Amplify Conference 2026 - 仕様からリリースまで一気通貫生成 AI 時代のフルスタック開発
inariku
3
400
メルカリのAI活用を支えるAIセキュリティ
s3h
7
4.8k
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
100
ファシリテーション勉強中 その場に何が求められるかを考えるようになるまで / 20260123 Naoki Takahashi
shift_evolve
PRO
3
390
みんなだいすきALB、NLBの 仕組みから最新機能まで総おさらい / Mastering ALB & NLB: Internal Mechanics and Latest Innovations
kaminashi
0
110
ドメイン駆動セキュリティへの道しるべ
pandayumi
0
180
一番人に近いコードレビューア CodeRabbit
kinopeee
0
110
ReproでのicebergのStreaming Writeの検証と実運用にむけた取り組み
joker1007
0
490
OCI技術資料 : OS管理ハブ 概要
ocise
2
4.3k
AI開発の落とし穴 〜馬には乗ってみよAIには添うてみよ〜
sansantech
PRO
9
4.8k
【northernforce#54】SalesforceにおけるAgentforceの位置づけ・事例紹介
yutosatou_kit
0
130
書籍執筆での生成AIの活用
sat
PRO
1
220
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
260
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1k
A better future with KSS
kneath
240
18k
Side Projects
sachag
455
43k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
75
Darren the Foodie - Storyboard
khoart
PRO
2
2.3k
The Invisible Side of Design
smashingmag
302
51k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
66
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