Closed bkielbasa closed 3 years ago
When storing custom structs in the context (to avoid global state) it's common to use similar code
v, err := ctx.Get(appKey{}) if err != nil { t.Error(err) return ctx } app := v.(sapp.App) app = app.Unhealthy()
The syntax would look similar to json.Unmarshal(). The above code would look like this:
json.Unmarshal()
var app sapp.App err := ctx.GetAs(appKey{}, &app) if err != nil { t.Error(err) return ctx } app = app.Unhealthy()
When storing custom structs in the context (to avoid global state) it's common to use similar code
The syntax would look similar to
json.Unmarshal()
. The above code would look like this: