code: func parseHeader(scanner *bufio.Scanner) (string, int, error) {
  	if !scanner.Scan() {
  		if err := scanner.Err(); err != nil {
  			return "", 0, err
  		}
  		// no more entries in the file, just return empty kind
  		return "", 0, nil
  	}
  	kind := scanner.Text()
  	if kind == "" {
  		return "", 0, fmt.Errorf("got an empty kind, expected 'files', 'symlinks' or 'dirs'")
  	}
  	if !scanner.Scan() {
  		if err := scanner.Err(); err != nil {
  			return "", 0, err
  		} else {
  			return "", 0, fmt.Errorf("expected a line with a count, unexpected EOF?")
  		}
  	}
  	countReader := strings.NewReader(scanner.Text())
  	count := 0
  	n, err := fmt.Fscanf(countReader, "(%d)", &count)
  	if err != nil {
  		return "", 0, err
  	}
  	if n != 1 {
  		return "", 0, fmt.Errorf("incorrectly formatted line with number of %s", kind)
  	}
  	return kind, count, nil
  }
docs: // parseHeader parses the first two lines of a block described in
  // ParseFilelist docs. So it returns a data kind (files, symlinks or
  // dirs) and a count of elements in the following list. If the
  // returned kind is empty then it means that there is no more entries
  // (provided that there is no error either).