The behavior I have in mind is the same as the readAttrsList function except instead of this line:

    if strings.HasPrefix(line, startKey) { // new entry begins

you'll have:

    if strings.HasPrefix(line, "file: ") || strings.HasPrefix(line, "directory: ") { // new entry begins