You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cnab.go
    path of file: ./repos/harbor/src/controller/artifact/processor/cnab
    
    the code of the file until where you have to start completion: // Copyright Project Harbor Authors
//
// Licensed under the Apache License, Version 2.0 (the "Licen
    
func (p *processor) AbstractMetadata(ctx context.Context, art *artifact.Artifact, _ []byte) error {
	cfgManiDgt := ""
	// try to get the digest of the manifest that the config layer is referenced by
	for _, reference := range art.References {
		if reference.Annotations != nil &&
			reference.Annotations["io.cnab.manifest.type"] == "config" {
			cfgManiDgt = reference.ChildDigest
		}
	}
	if len(cfgManiDgt) == 0 {
		return nil
	}

	// get the manifest that the config layer is referenced by
	mani, _, err := p.RegCli.PullManifest(art.RepositoryName, cfgManiDgt)
	if err != nil {
		return err
	}
	_, payload, err := mani.Payload()
	if err != nil {
		return err
	}

	// abstract the metadata from config layer
	return p.manifestProcessor.AbstractMetadata(ctx, art, payload)
}