| 12345678910111213141516171819202122232425262728293031323334 | package sessionimport (	"context"	"math/rand")type ID uint32func NewID() ID {	for {		id := ID(rand.Uint32())		if id != 0 {			return id		}	}}type sessionKey intconst (	idSessionKey sessionKey = iota)func ContextWithID(ctx context.Context, id ID) context.Context {	return context.WithValue(ctx, idSessionKey, id)}func IDFromContext(ctx context.Context) ID {	if id, ok := ctx.Value(idSessionKey).(ID); ok {		return id	}	return 0}
 |