code: func stateFromContext(ctx context.Context) *State {
  	if ret := ctx.Value(stateKey); ret != nil {
  		return ret.(*State)
  	}
  
  	return globalState
  }
docs: // stateFromContext returns a State instance from the given context, if there
  // is one; otherwise the default State is returned.