code: func (b *ScriptBuilder) AddData(data []byte) *ScriptBuilder {
  	if b.err != nil {
  		return b
  	}
  
  	// Pushes that would cause the script to exceed the largest allowed
  	// script size would result in a non-canonical script.
  	dataSize := canonicalDataSize(data)
  	if len(b.script)+dataSize > MaxScriptSize {
  		str := fmt.Sprintf("adding %d bytes of data would exceed the "+
  			"maximum allowed canonical script length of %d",
  			dataSize, MaxScriptSize)
  		b.err = ErrScriptNotCanonical(str)
  		return b
  	}
  
  	// Pushes larger than the max script element size would result in a
  	// script that is not canonical.
  	dataLen := len(data)
  	if dataLen > MaxScriptElementSize {
  		str := fmt.Sprintf("adding a data element of %d bytes would "+
  			"exceed the maximum allowed script element size of %d",
  			dataLen, MaxScriptElementSize)
  		b.err = ErrScriptNotCanonical(str)
  		return b
  	}
  
  	return b.addData(data)
  }
docs: // AddData pushes the passed data to the end of the script.  It automatically
  // chooses canonical opcodes depending on the length of the data.  A zero length
  // buffer will lead to a push of empty data onto the stack (OP_0) and any push
  // of data greater than MaxScriptElementSize will not modify the script since
  // that is not allowed by the script engine.  Also, the script will not be
  // modified if pushing the data would cause the script to exceed the maximum
  // allowed script engine size.