code: func (s *IssueService) PostAttachment(issueID string, r io.Reader, attachmentName string) (*[]Attachment, *Response, error) {
  	apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s/attachments", issueID)
  
  	b := new(bytes.Buffer)
  	writer := multipart.NewWriter(b)
  
  	fw, err := writer.CreateFormFile("file", attachmentName)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	if r != nil {
  		// Copy the file
  		if _, err = io.Copy(fw, r); err != nil {
  			return nil, nil, err
  		}
  	}
  	writer.Close()
  
  	req, err := s.client.NewMultiPartRequest("POST", apiEndpoint, b)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	req.Header.Set("Content-Type", writer.FormDataContentType())
  
  	// PostAttachment response returns a JSON array (as multiple attachments can be posted)
  	attachment := new([]Attachment)
  	resp, err := s.client.Do(req, attachment)
  	if err != nil {
  		jerr := NewJiraError(resp, err)
  		return nil, resp, jerr
  	}
  
  	return attachment, resp, nil
  }
docs: // PostAttachment uploads r (io.Reader) as an attachment to a given issueID