code: func checkPkScriptStandard(pkScript []byte, scriptClass txscript.ScriptClass) error {
  	switch scriptClass {
  	case txscript.MultiSigTy:
  		numPubKeys, numSigs, err := txscript.CalcMultiSigStats(pkScript)
  		if err != nil {
  			str := fmt.Sprintf("multi-signature script parse "+
  				"failure: %v", err)
  			return txRuleError(wire.RejectNonstandard, str)
  		}
  
  		// A standard multi-signature public key script must contain
  		// from 1 to maxStandardMultiSigKeys public keys.
  		if numPubKeys < 1 {
  			str := "multi-signature script with no pubkeys"
  			return txRuleError(wire.RejectNonstandard, str)
  		}
  		if numPubKeys > maxStandardMultiSigKeys {
  			str := fmt.Sprintf("multi-signature script with %d "+
  				"public keys which is more than the allowed "+
  				"max of %d", numPubKeys, maxStandardMultiSigKeys)
  			return txRuleError(wire.RejectNonstandard, str)
  		}
  
  		// A standard multi-signature public key script must have at
  		// least 1 signature and no more signatures than available
  		// public keys.
  		if numSigs < 1 {
  			return txRuleError(wire.RejectNonstandard,
  				"multi-signature script with no signatures")
  		}
  		if numSigs > numPubKeys {
  			str := fmt.Sprintf("multi-signature script with %d "+
  				"signatures which is more than the available "+
  				"%d public keys", numSigs, numPubKeys)
  			return txRuleError(wire.RejectNonstandard, str)
  		}
  
  	case txscript.NonStandardTy:
  		return txRuleError(wire.RejectNonstandard,
  			"non-standard script form")
  	}
  
  	return nil
  }
docs: // checkPkScriptStandard performs a series of checks on a transaction output
  // script (public key script) to ensure it is a "standard" public key script.
  // A standard public key script is one that is a recognized form, and for
  // multi-signature scripts, only contains from 1 to maxStandardMultiSigKeys
  // public keys.