code: func (f *Function) versionsToCleanup() ([]*lambda.FunctionConfiguration, error) {
  	versions, err := f.versions()
  	if err != nil {
  		return nil, err
  	}
  
  	if *f.RetainedVersions == 0 {
  		return versions, nil
  	}
  
  	if len(versions) > *f.RetainedVersions {
  		return versions[:len(versions)-*f.RetainedVersions], nil
  	}
  
  	return nil, nil
  }
docs: // versionsToCleanup returns list of versions to remove after updating function