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.

データ型

データ型 意味
int 数値
string 文字列
bool 真偽値
float64 浮動小数点

繰り返し

無限ループ
for {
    処理
}
カウンタ付きループ
for i := 0; i < 10; i++ {
    処理
}
オブジェクトループ
fruits := [5]string{"りんご", "バナナ", "いちご", "もも", "ぶどう"}

for i, s := range fruits {
    処理
    // iはインデックス番号
    // sはオブジェクト
}

日付関連

タイムゾーン設定

const location = "Asia/Tokyo"
loc, err := time.LoadLocation(location)
if err != nil {
    loc = time.FixedZone(location, 9 * 60 * 60)
}
time.Now.In(loc)
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?