code: func (i *ResourceInstance) GetGeneration(gen Generation) *ResourceInstanceObjectSrc {
  	if gen == CurrentGen {
  		return i.Current
  	}
  	if dk, ok := gen.(DeposedKey); ok {
  		return i.Deposed[dk]
  	}
  	if gen == nil {
  		panic(fmt.Sprintf("get with nil Generation"))
  	}
  	// Should never fall out here, since the above covers all possible
  	// Generation values.
  	panic(fmt.Sprintf("get invalid Generation %#v", gen))
  }
docs: // GetGeneration retrieves the object of the given generation from the
  // ResourceInstance, or returns nil if there is no such object.
  //
  // If the given generation is nil or invalid, this method will panic.