Files
go-proton-api/manager_report.go
2022-11-23 12:03:04 +01:00

21 lines
428 B
Go

package proton
import (
"bytes"
"context"
)
func (m *Manager) ReportBug(ctx context.Context, req ReportBugReq, atts ...ReportBugAttachment) error {
r := m.r(ctx).SetMultipartFormData(req.toFormData())
for _, att := range atts {
r = r.SetMultipartField(att.Name, att.Filename, string(att.MIMEType), bytes.NewReader(att.Body))
}
if _, err := r.Post("/core/v4/reports/bug"); err != nil {
return err
}
return nil
}