code: func (n *metadataNode) attachACL(role string, e *packageACL) {
  	n.assertNonFrozen()
  
  	// 'acls' are ordered by legacyRoles. Insert 'e' into the corresponding slot.
  	// Such ordering is required by mergeIntoPrefixMetadata used by 'freeze'.
  	for i, r := range legacyRoles {
  		if r == role {
  			if n.acls[i] != nil {
  				panic(fmt.Sprintf("metadata for role %q at %q is already attached", role, n.prefix))
  			}
  			n.acls[i] = e
  			return
  		}
  	}
  
  	// 'attachACL' is called only with roles validated by packageACL.parseKey(),
  	// so this is impossible.
  	panic(fmt.Sprintf("unexpected impossible role %q", role))
  }
docs: // attachACL attaches a packageACL to this node.
  //
  // All such attached ACLs are merged into single PrefixMetadata in 'freeze'.