0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【#32 エンジニア転職学習】Go WebApplications http/template

0
Posted at

はじめに

富山県に住んでいるChikaといいます。
毎日投稿を目標に、バックエンドエンジニア転職に向けた学習内容をアウトプットします。

使用しているGoのUdemy教材後半部分である、
Webアプリ作成演習を学習していきます。

バックエンドエンジニアになるまでの学習内容は以前投稿した以下の記事を基にしています。

本日の学習内容

本日はGoのwebアプリ用標準パッケージを中心に学習しました。

  • ioutil
  • http.ListenAndServe
  • http/template <--Topics!
  • http.Redirect

http/template

各ハンドラーからHTMLファイルを読み書きを可能にするメソッド等が入っているパッケージです。フロントエンドとバックエンドの連携が見れたので、少し感動です。

  • template.ParseFiles(File名)で指定ファイルのテンプレートを作成
  • template.Executeで指定ファイルへ出力を書き込む
  • HTML内
    • {{}}と囲むことでstructの呼び出しや、printfの使用ができる

使用している教材はこちら↓

おわりに

最後までお読みいただきありがとうございました。
アドバイス・応援コメント等いただけますと幸いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?