code: func GetCCPackage(buf []byte) (CCPackage, error) {
  	// try raw CDS
  	cds := &CDSPackage{}
  	if ccdata, err := cds.InitFromBuffer(buf); err != nil {
  		cds = nil
  	} else {
  		err = cds.ValidateCC(ccdata)
  		if err != nil {
  			cds = nil
  		}
  	}
  
  	// try signed CDS
  	scds := &SignedCDSPackage{}
  	if ccdata, err := scds.InitFromBuffer(buf); err != nil {
  		scds = nil
  	} else {
  		err = scds.ValidateCC(ccdata)
  		if err != nil {
  			scds = nil
  		}
  	}
  
  	if cds != nil && scds != nil {
  		// Both were unmarshaled successfully, this is exactly why the approach of
  		// hoping proto fails for bad inputs is fatally flawed.
  		ccproviderLogger.Errorf("Could not determine chaincode package type, guessing SignedCDS")
  		return scds, nil
  	}
  
  	if cds != nil {
  		return cds, nil
  	}
  
  	if scds != nil {
  		return scds, nil
  	}
  
  	return nil, errors.New("could not unmarshal chaincode package to CDS or SignedCDS")
  }
docs: // GetCCPackage tries each known package implementation one by one
  // till the right package is found