code: func compressedScriptSize(pkScript []byte) int {
  	// Pay-to-pubkey-hash script.
  	if valid, _ := isPubKeyHash(pkScript); valid {
  		return 21
  	}
  
  	// Pay-to-script-hash script.
  	if valid, _ := isScriptHash(pkScript); valid {
  		return 21
  	}
  
  	// Pay-to-pubkey (compressed or uncompressed) script.
  	if valid, _ := isPubKey(pkScript); valid {
  		return 33
  	}
  
  	// When none of the above special cases apply, encode the script as is
  	// preceded by the sum of its size and the number of special cases
  	// encoded as a variable length quantity.
  	return serializeSizeVLQ(uint64(len(pkScript)+numSpecialScripts)) +
  		len(pkScript)
  }
docs: // compressedScriptSize returns the number of bytes the passed script would take
  // when encoded with the domain specific compression algorithm described above.