import "github.com/btcsuite/btcutil" // tx is an instance of a Bitcoin transaction txHash := tx.TxHash()
import "github.com/btcsuite/btcutil" address := "1FEtRdR7SiCTcjumvFbNjDRLtPKxo2fVx3" publicKeyHash, err := btcutil.DecodeAddress(address, nil) if err != nil { // handle error } else { // do something with publicKeyHash }In this example, we're importing the btcutil package and then calling the DecodeAddress function on a Bitcoin address. The publicKeyHash variable will contain the 20-byte public key hash of the Bitcoin address. Overall, the btcutil package is a useful collection of Bitcoin-related utility functions and types for Go developers.