code: func initParams(c context.Context, streams []*coordinator.LogStream, project types.ProjectName) ([]fetchParams, error) {
  	states := make([]*coordinator.LogStreamState, len(streams))
  	for i, stream := range streams {
  		states[i] = stream.State(c)
  	}
  	// Get the log states, which we use to fetch the backend storage.
  	switch err := datastore.Get(c, states); {
  	case datastore.IsErrNoSuchEntity(err):
  		return nil, coordinator.ErrPathNotFound
  	case err != nil:
  		return nil, err
  	}
  
  	// Get the backend storage instances.  These will be closed in fetch.
  	params := make([]fetchParams, len(streams))
  	for i, stream := range streams {
  		st, err := flex.GetServices(c).StorageForStream(c, states[i], project)
  		if err != nil {
  			return nil, err
  		}
  		params[i] = fetchParams{
  			storage: st,
  			stream:  stream,
  			state:   states[i],
  		}
  	}
  
  	return params, nil
  }
docs: // initParams generates a set of params for each LogStream given.