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
2022-10-15大LT.pdf
Search
yuorei
February 20, 2023
0
23
2022-10-15大LT.pdf
yuorei
February 20, 2023
Tweet
Share
More Decks by yuorei
See All by yuorei
オブザーバビリティを意識したアプリケーション/Observability-Aware Applications
yuorei
0
61
Rust + Cloudflare Workersで作る HLS 認証プロキシ
yuorei
0
150
GraphQLについて調べてみた
yuorei
0
68
GoでLINEbot入門
yuorei
0
70
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Producing Creativity
orderedlist
PRO
348
40k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
The Curse of the Amulet
leimatthew05
1
8.6k
GraphQLとの向き合い方2022年版
quramy
50
14k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
93
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
What's in a price? How to price your products and services
michaelherold
247
13k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
250
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Transcript
単語を記録するWEBアプリ ケーションを作ってみた
作った動機 ◦最近よくGoをよくみるなと思いせっかくの夏休みな ので何か作りたい ◦DBとSQLも扱えるようになりたい ◦単語を覚えたい ◦ログイン機能作りたい
完成した作品
技術スタック ◦Go ◦HTML ◦MySQL
Webサーバーを立てる 簡単
URLごとの処理 ◦ハンドラというものを使ってURLごとにやりたいことを処理 します
ホームページからの入力を受け取り
テンプレート機能
MySQLを扱う ◦GoでMySQLを扱うにはドライ バーを使います ◦今回はINSERTとSELECTを実装 しました ◦テーブルは2つ用意しました ◦User(id,name,password) ◦Word(id,word,meaning)
◦ユーザー登録の際にidを付与します ◦そのidを使用して単語登録の際にid と一緒に単語を登録 ◦idを使ってSELECTして登録した 単語の表示をします
参考 GoとHTMLについて ◦ 【Go実践】フォームで入力された情報をデータベースに登録する ◦ 【Go実践】POSTされたデータを受け取って処理する ― 入力フォームと確認 画面の作成 ◦
【Go実践】同一のテンプレートを使って新規登録画面と編集画面を実装する ― テンプレートの分岐処理 ◦ 【Golang】MySQLの基本的な操作を行う ◦ Go言語(golang) テンプレートの使い方
GoとMySQLについて ◦ 【Go実践】GoでMySQLを使おう(1) – ドライバのインストールからデータ ベース接続まで ◦ GO言語(golang)のデータベース(MariaDB・MySQL)操作(1) /database/sqlで最低限のクエリ ◦
go言語 mysqlに接続してinsertを実行する ◦ Go言語でMySQL の基本的操作(SELECT、UPDATE、INSERT)を行 う ◦ GoでSQLのSELECTをする
Goについて ◦nilとの付き合い方(panic: runtime error: invalid memory address or nil pointer
dereference) ◦golang 文字列→数値、数値→文字列変換 ◦[Go言語] ファイル分割とローカルパッケージ