mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 05:16:10 +00:00
[Golang] Move utility functions from client.mustache to utils.mustache (#19001)
* [Golang] Move utility functions from client.mustache to utils.mustache * re-generate Go samples * re-generate Go samples again * re-generate samples once more * update go samples --------- Co-authored-by: Martin Lakov <martin.lakov@ocado.com>
This commit is contained in:
@@ -519,18 +519,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Prevent trying to import "fmt"
|
||||
func reportError(format string, a ...interface{}) error {
|
||||
return fmt.Errorf(format, a...)
|
||||
}
|
||||
|
||||
// A wrapper for strict JSON decoding
|
||||
func newStrictDecoder(data []byte) *json.Decoder {
|
||||
dec := json.NewDecoder(bytes.NewBuffer(data))
|
||||
dec.DisallowUnknownFields()
|
||||
return dec
|
||||
}
|
||||
|
||||
// Set request body from an interface{}
|
||||
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
|
||||
if bodyBuf == nil {
|
||||
|
||||
Reference in New Issue
Block a user