go: minor refactoring (#16508)

This commit is contained in:
William Cheng 2023-09-06 11:02:09 +08:00 committed by GitHub
parent b34a10aee7
commit b1ec110aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,10 +413,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
if (ModelUtils.isStringSchema(p) || isAllOfStringSchema(p)) {
Object defaultObj = p.getDefault();
if (defaultObj != null) {
if (defaultObj instanceof java.lang.String) {
return "\"" + escapeText((String) defaultObj) + "\"";
}
return "\"" + escapeText(defaultObj.toString()) + "\"";
return "\"" + escapeText(String.valueOf(defaultObj)) + "\"";
}
return null;
}