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
2022-10-15大LT.pdf
Search
yuorei
February 20, 2023
29
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
2022-10-15大LT.pdf
yuorei
February 20, 2023
More Decks by yuorei
See All by yuorei
オブザーバビリティを意識したアプリケーション/Observability-Aware Applications
yuorei
0
76
Rust + Cloudflare Workersで作る HLS 認証プロキシ
yuorei
0
210
GraphQLについて調べてみた
yuorei
0
82
GoでLINEbot入門
yuorei
0
81
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
380
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
550
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
900
Crafting Experiences
bethany
1
370
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
How to Ace a Technical Interview
jacobian
280
24k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
The agentic SEO stack - context over prompts
schlessera
0
950
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
480
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
560
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言語] ファイル分割とローカルパッケージ