code: func (s PkScript) Script() []byte {
  	var script []byte
  
  	switch s.class {
  	case PubKeyHashTy:
  		script = make([]byte, pubKeyHashLen)
  		copy(script, s.script[:pubKeyHashLen])
  
  	case WitnessV0PubKeyHashTy:
  		script = make([]byte, witnessV0PubKeyHashLen)
  		copy(script, s.script[:witnessV0PubKeyHashLen])
  
  	case ScriptHashTy:
  		script = make([]byte, scriptHashLen)
  		copy(script, s.script[:scriptHashLen])
  
  	case WitnessV0ScriptHashTy:
  		script = make([]byte, witnessV0ScriptHashLen)
  		copy(script, s.script[:witnessV0ScriptHashLen])
  
  	default:
  		// Unsupported script type.
  		return nil
  	}
  
  	return script
  }
docs: // Script returns the script as a byte slice without any padding.