code: func ChainID(dgsts []digest.Digest) digest.Digest {
  	chainIDs := make([]digest.Digest, len(dgsts))
  	copy(chainIDs, dgsts)
  	ChainIDs(chainIDs)
  
  	if len(chainIDs) == 0 {
  		return ""
  	}
  	return chainIDs[len(chainIDs)-1]
  }
docs: // ChainID takes a slice of digests and returns the ChainID corresponding to
  // the last entry. Typically, these are a list of layer DiffIDs, with the
  // result providing the ChainID identifying the result of sequential
  // application of the preceding layers.