I hereby claim:
- I am cep21 on github.
- I am cep21 (https://keybase.io/cep21) on keybase.
- I have a public key ASAwNIEREtDh3M0e-0fmJBK5AlukNaSfZzfs3spchpbB2Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| type Ship2 struct { | |
| GameKillable | |
| PhysicalObject | |
| } | |
| type PhysicalObject struct { | |
| LocX float64 | |
| LocY float64 | |
| Size float64 | |
| } |
| type Ship struct { | |
| Health int | |
| LocX float64 | |
| LocY float64 | |
| Size float64 | |
| } | |
| func (s *Ship) Heal(amnt int) { | |
| if s.Health >= 0 { | |
| s.Health += amnt |
| package main | |
| import ( | |
| "sync" | |
| "testing" | |
| ) | |
| func TestAppend(t *testing.T) { | |
| x := make([]string, 0, 6) | |
| x = append(x, "start") |
| package main | |
| import ( | |
| "testing" | |
| "sync" | |
| ) | |
| func TestAppend(t *testing.T) { | |
| x := make([]string, 0, 6) |
| package main | |
| import ( | |
| "sync" | |
| "testing" | |
| ) | |
| func TestAppend(t *testing.T) { | |
| x := []string{"start"} |
| package trace_110 | |
| import ( | |
| "testing" | |
| "sync" | |
| "fmt" | |
| "time" | |
| "net/http" | |
| ) |
| // From package A | |
| package a | |
| type T int64 | |
| type S struct{} | |
| func (s *S) TypedFunction() T { | |
| return T(0) | |
| } |
| type I interface { | |
| Func() | |
| } | |
| type I2 interface { | |
| Another() | |
| } | |
| type I3 interface { | |
| Func() | |
| Another() | |
| } |
| type ObjectCache {} | |
| func (r *ObjectCache) Cached(ctx context.Context, key string, callback func() (interface{}, error), storeIntoPtr interface{}) error { | |
| // Check cache for object, if it exists, get it from cache, otherwise call callback, store to cache, and put result | |
| // into storeIntoPtr pointer | |
| } | |
| func (app * Application) UserCode(ctx context.Context) (*UserProfile, error) { | |
| var ret *UserProfile | |
| err := app.Cache.Cached(ctx, "user:" + userID, func() (interface{}, error) { |