code: func (p *CONNECT) setPayload() {
  	// Append the Client Identifier to the payload.
  	p.payload = appendLenStr(p.payload, p.clientID)
  
  	// Append the Will Topic and the Will Message to the payload
  	// if the Packet has them.
  	if p.will() {
  		p.payload = appendLenStr(p.payload, p.willTopic)
  		p.payload = appendLenStr(p.payload, p.willMessage)
  	}
  
  	// Append the User Name to the payload if the Packet has it.
  	if len(p.userName) > 0 {
  		p.payload = appendLenStr(p.payload, p.userName)
  	}
  
  	// Append the Password to the payload if the Packet has it.
  	if len(p.password) > 0 {
  		p.payload = appendLenStr(p.payload, p.password)
  	}
  }
docs: // setPayload sets the payload to the Packet.