code: func (list *Lists) ParseFilelist(filelist io.Reader) error {
  	scanner := bufio.NewScanner(filelist)
  	for {
  		kind, count, err := parseHeader(scanner)
  		if err != nil {
  			return errwrap.Wrap(errors.New("failed to parse filelist"), err)
  		}
  		if kind == "" {
  			break
  		}
  		data := list.getDataForKind(kind)
  		if data == nil {
  			return fmt.Errorf("failed to parse filelist: unknown kind %q, expected 'files', 'symlinks' or 'dirs'", kind)
  		}
  		items, err := parseList(scanner, count)
  		if err != nil {
  			return errwrap.Wrap(errors.New("failed to parse filelist"), err)
  		}
  		*data = items
  	}
  	return nil
  }
docs: // ParseFilelist parses a given filelist. The filelist format is
  // rather simple:
  // <BLOCK>
  // <BLOCK>
  // ...
  //
  // Where "<BLOCK>" is as follows:
  // <HEADER>
  // <LIST>
  //
  // Where "<HEADER>" is as follows:
  // <KIND>
  // (<COUNT>)
  //
  // Where "<KIND>" is either "files", "symlinks" or "dirs" and
  // "<COUNT>" tells how many items are in the following list. "<LIST>"
  // is as follows:
  // <1st ITEM>
  // <2nd ITEM>
  // ...
  // <COUNTth ITEM>
  // <EMPTY LINE>