Skip to content

Commit

Permalink
[go] fix issue that tempfile is not deleted (OpenAPITools#16303)
Browse files Browse the repository at this point in the history
* OpenAPITools#15131 Issue: Tempfile is not deleted

* delete tempfile in go client

---------

Co-authored-by: Aniruddh <[email protected]>
  • Loading branch information
wing328 and aniruddhJo authored Aug 11, 2023
1 parent 8885701 commit 2635b52
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
return
}
_, err = f.Seek(0, io.SeekStart)
err = os.Remove(f.Name())
return
}
if f, ok := v.(**os.File); ok {
Expand All @@ -533,6 +534,7 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
return
}
_, err = (*f).Seek(0, io.SeekStart)
err = os.Remove((*f).Name())
return
}
if xmlCheck.MatchString(contentType) {
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/go/go-petstore/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions samples/openapi3/client/petstore/go/go-petstore/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2635b52

Please sign in to comment.