You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-scm/scm/driver/stash/multipart.go

27 lines
422 B
Go

package stash
import "mime/multipart"
type MultipartWriter struct {
Writer *multipart.Writer
Error error
}
func (mw *MultipartWriter) Write(f, v string) {
if mw.Error != nil {
return
}
if v == "" {
return
}
mw.Error = mw.Writer.WriteField(f, v)
}
func (mw *MultipartWriter) Close() {
mw.Writer.Close()
}
func (mw *MultipartWriter) FormDataContentType() string {
return mw.Writer.FormDataContentType()
}