Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Golang Beginners!
Search
yukpiz
October 23, 2018
Technology
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Golang Beginners!
Okinawa.go #10の資料です!
yukpiz
October 23, 2018
More Decks by yukpiz
See All by yukpiz
Go x AWSによるシンプルなサーバーレス実装
yukpiz
1
590
Go x AWSによるシンプルなサーバーレス実装
yukpiz
1
130
Go言語と事例で学ぶAWS Lambda
yukpiz
3
1.1k
Other Decks in Technology
See All in Technology
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
1.7k
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
680
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
150
Redmine 7.0で私が開発した新機能の狙いと背景
vividtone
1
150
AI 駆動 Terraform 開発/SRE_BizReach_MIXI_2
visional_engineering_and_design
3
2k
Reactの設計論
uhyo
14
7.4k
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
140
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
290
When Does a Local Qwen Start to Break
morshoto
0
200
2026-09-09 【sigma_ucj#1】Sigma を IaC 管理したい! / IaC for Sigma
civitaspo
0
110
クロスボーダーM&AのValue Upを支えるプロダクト開発。日米チームのハブになったプロダクトエンジニアの実践 / Product Engineering Conference 2026
genda
0
110
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
260
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
690
Between Models and Reality
mayunak
4
450
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
320
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Typedesign – Prime Four
hannesfritz
42
3.2k
Transcript
Golang Beginners! Written by @yukpiz Oct 4, 2018 Lightning talks
party night! at Okinawa! Oct 23, 2018 Okinawa.go #10
Agenda //\\\\\\ Tadaima //\\\\\\\ What’s golang? //\\\\\\\\ Let’s hands-on! //\\\\\\\\\
Variables //\\\\\\\\\\ Array & Slice //\\\\\\\\\\\ Pointer //\\\\\\\\\\\\ Closing
Tadaima 沖縄Go言語LT大会
Tadaima //\ 東京のスタートアップでGo言語 //\\\ Twitter @yukpiz(https://yukpiz.github.io) //\\\\\ #golang #AWS #Vim
#Fishing //\\\\\\\ エンジニアの登壇を応援する会 //\\\\\\\ GoCon 2018のCfPを考え中 //\\\\\\\\\ せっかくなので沖縄でイベント開催してみよう!
Agenda //\\\\\\ Tadaima //\\\\\\\ What’s golang? //\\\\\\\\ Let’s hands-on! //\\\\\\\\\
Variables //\\\\\\\\\\ Array & Slice //\\\\\\\\\\\ Pointer //\\\\\\\\\\\\ Closing
What’s golang? mainパッケージだとコマンドライン実行可能 標準で言語に含まれるパッケージでも、 利用するときはimportする mainパッケージの場合、 実行時にmain関数が呼び出される
What’s golang? //\ 2012年にリリース(現在v1.11、go2のドラフト発表) //\\\ コマンドラインツール、WebAPI、バッチ処理 //\\\\\ AWS Lambda、GAE/Go、Cloud Function(Coming
soon!) //\\\\\\\ 静的型付け言語、並列実行に強い、シンプルな構文 //\\\\\\\\\ クローラー、メッセージ一斉配信、WebAPI
Agenda //\\\\\\ Tadaima //\\\\\\\ What’s golang? //\\\\\\\\ Let’s hands-on! //\\\\\\\\\
Variables //\\\\\\\\\\ Array & Slice //\\\\\\\\\\\ Pointer //\\\\\\\\\\\\ Closing
Let’s hands-on! //\ 9月に東京で初心者向けのハンズオンをやった //\\\ 言語仕様から頑張って勉強した //\\\\\ 言語仕様、わかってるつもりだったけど難しかった //\\\\\\\ 以下にハンズオン内容が公開されています!
スライド:https://techdo.connpass.com/event/100306/ 課題内容:https://qiita.com/yukpiz/items/384093ce65c56451bd97
Agenda //\\\\\\ Tadaima //\\\\\\\ What’s golang? //\\\\\\\\ Let’s hands-on! //\\\\\\\\\
Variables //\\\\\\\\\\ Array & Slice(WARN) //\\\\\\\\\\\ Pointer(DANGER) //\\\\\\\\\\\\ Closing
Variables 1st //\ 基本的な変数の扱いを学ぶ //\\\ 知っておくと得する、変数についての豆知識を学ぶ
Variables 2nd 変数が宣言されると、ゼロ値で初期化される 宣言と初期化を明示的に行なえる :=でvarを省略できる 宣言済みの変数には代入ができる 未宣言の変数に代入はできない 再宣言はできない
Variables 3rd ここに入ると変数pはメモリ上に 確保されるが、使用されない 使用する直前で宣言しよう
Variables 4th //\ 宣言と代入の違いを理解しよう //\\\ 未使用変数を残して、コンパイルできない //\\\\\ 変数は宣言された位置でメモリが確保される //\\\\\\\ 変数宣言は使用する直前に書くように心がける
Agenda //\\\\\\ Tadaima //\\\\\\\ What’s golang? //\\\\\\\\ Let’s hands-on! //\\\\\\\\\
Variables //\\\\\\\\\\ Array & Slice(WARN) //\\\\\\\\\\\ Pointer(DANGER) //\\\\\\\\\\\\ Closing
Array & Slice 1st //\ 基本的な配列とスライスの使い方を学ぶ //\\\ 配列とスライスの違いを理解する
Array & Slice 2nd 容量3のint型の配列 容量5のint型の配列 容量が違う配列は、 異なる型として扱われる 変数の種別は同じ配列
Array & Slice 3rd [0] 1 [1] 2 [2] 3
[3] 4 [4] 5 [5] 6 [6] 7 [7] 8 [8] 9 [9] 10 容量10のint配列(実体) 要素1~5番目までを 参照するスライス 実体の配列が変更される Length(長さ)はスライスの長さ5 Capacity(容量)は実体配列の容量10
Array & Slice 4th 容量を省略するとスライスになる スライスは可変長のように扱える 再スライスができる [0] 1 [1]
2 容量2のint配列(実体) [0] 1 [1] 2 [2] 3 [3] 4 容量4のint配列(実体) - 実体の配列に要素を2つ追加したい - 実体の配列は容量2なので足りない - 新しい配列が生成される - 新しい配列へのスライスが返される
Array & Slice 1st //\ 配列は固定長、スライスは可変長(のように振る舞う) //\\\ 配列は実体、スライスは配列の参照 //\\\\\ 暗黙的に配列の実体が再生成される場合がある
Agenda //\\\\\\ Tadaima //\\\\\\\ What’s golang? //\\\\\\\\ Let’s hands-on! //\\\\\\\\\
Variables //\\\\\\\\\\ Array & Slice(WARN) //\\\\\\\\\\\ Pointer(DANGER) //\\\\\\\\\\\\ Closing
Pointer 1st //\ 基本的なポインタの扱いを学ぶ //\\\ パフォーマンスを意識したコードを書けるようになる
Pointer 2st Profile構造体のポインタ変数を宣言、初期化 ポインタ変数はメモリ番地を出力できる ”&”がついているのはポインタ変数 ”*”をつけてアクセスすると値が得られる ポインタ変数でもフィールドにアクセス可能
Pointer 3rd f1にポインタ変数を渡す f2に値を渡す Profile構造体のポインタ変数を 引数に取る関数 Profile構造体の値を 引数に取る関数
Pointer 4th //\ 値コピーを避ける為にポインタを利用する //\\\ ポインタ変数であってもフィールドにアクセスができる //\\\\\ 特に値コピーによる関数の引数でポインタを使う
Summaries!
You have a fun golang life! //\ APIやバッチ処理での活用事例が増えている言語 //\\\ パッケージ管理が標準導入されたり(v1.12)
//\\\\\ go2のドラフトデザインが発表されたり //\\\\\\\ Go言語の書けるエンジニア少ない
Agenda //\\\\\\ Tadaima //\\\\\\\ What’s golang? //\\\\\\\\ Let’s hands-on! //\\\\\\\\\
Variables //\\\\\\\\\\ Array & Slice //\\\\\\\\\\\ Pointer //\\\\\\\\\\\\ Closing
Closing? No!! Please join us! for After-Party:)
@yukpiz リピーターに長く愛される そんなお店づくりを支援したい * Marketing Support * Concierge Support *
Opening Support for Restaurants !! yukpiz We are hiring!
Thanks! func thanks() { fmt.Println(“Thank you for join & listening
”) os.Exit(0) } Special Thanks! The Go gopher was designed by Renée French. Free gophers: https://github.com/egonelbre/gophers