forked from loafle/openapi-generator-original
go: add os import in case of File return type (#3996)
This commit is contained in:
parent
775d96c8e6
commit
c8ac41c051
@ -377,6 +377,11 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
boolean addedOSImport = false;
|
||||
boolean addedReflectImport = false;
|
||||
for (CodegenOperation operation : operations) {
|
||||
// import "os" if the operation uses files
|
||||
if (!addedOSImport && "*os.File".equals(operation.returnType)) {
|
||||
imports.add(createMapping("import", "os"));
|
||||
addedOSImport = true;
|
||||
}
|
||||
for (CodegenParameter param : operation.allParams) {
|
||||
// import "os" if the operation uses files
|
||||
if (!addedOSImport && "*os.File".equals(param.dataType)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user