1. The Go gopher was designed by Renée French.
The gopher stickers was made by Takuya Ueda.
Licensed under the Creative Commons 3.0 Attributions license.
Go1.8 for
Google App Engine
@GDG DevFest Tokyo 2017
2017年10月09日(月)
ハッシュタグ:
#DevFest17 #DevFest_room1
16. Google App Engineとコンテキスト
■ 例:Datastoreからデータの取得
16
type Person struct {
ID int64 `datastore:"-"`
Name string `datastore:"name"`
Age int `datastore:"age"`
}
const k = "Person" // Kind名
key := datastore.NewKey(ctx, k,"",100, nil)
var p Person
if err := datastore.Get(ctx, key, &p); err != nil { /*エラー処理*/}
p.ID = key.IntID()
第1引数でコンテキストを指定