Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -850,5 +850,7 @@ protected boolean isNumberType(String datatype) {
}

@Override
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GO; }
public GeneratorLanguage generatorLanguage() {
return GeneratorLanguage.GO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public GoClientCodegen() {

// option to change the order of form/body parameter
cliOptions.add(CliOption.newBoolean(
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS,
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC)
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS,
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC)
.defaultValue(Boolean.FALSE.toString()));

cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false"));
Expand Down Expand Up @@ -585,7 +585,7 @@ private String constructExampleCode(CodegenProperty codegenProperty, HashMap<Str
example = "123";
}

return codegenProperty.dataType + "(" + example + ")";
return codegenProperty.dataType + "(" + example + ")";
}
} else {
// look up the model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ public void processOpts() {
* are available in models, apis, and supporting files
*/
if (additionalProperties.containsKey("apiVersion")) {
this.apiVersion = (String)additionalProperties.get("apiVersion");
this.apiVersion = (String) additionalProperties.get("apiVersion");
} else {
additionalProperties.put("apiVersion", apiVersion);
}

if (additionalProperties.containsKey("serverPort")) {
this.serverPort = Integer.parseInt((String)additionalProperties.get("serverPort"));
this.serverPort = Integer.parseInt((String) additionalProperties.get("serverPort"));
} else {
additionalProperties.put("serverPort", serverPort);
}

if (additionalProperties.containsKey("apiPath")) {
this.apiPath = (String)additionalProperties.get("apiPath");
this.apiPath = (String) additionalProperties.get("apiPath");
} else {
additionalProperties.put("apiPath", apiPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class GoServerCodegen extends AbstractGoCodegen {

/**
* Name of additional property for switching routers
* Name of additional property for switching routers
*/
private static final String ROUTER_SWITCH = "router";

Expand All @@ -43,7 +43,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
/**
* List of available routers
*/
private static final String[] ROUTERS = { "mux", "chi" };
private static final String[] ROUTERS = {"mux", "chi"};

private final Logger LOGGER = LoggerFactory.getLogger(GoServerCodegen.class);

Expand Down Expand Up @@ -85,7 +85,7 @@ public GoServerCodegen() {
.defaultValue(sourceFolder));

CliOption frameworkOption = new CliOption(ROUTER_SWITCH, ROUTER_SWITCH_DESC);
for (String option: ROUTERS) {
for (String option : ROUTERS) {
frameworkOption.addEnum(option, option);
}
frameworkOption.defaultValue(ROUTERS[0]);
Expand Down Expand Up @@ -225,7 +225,7 @@ public void processOpts() {

final Object propRouter = additionalProperties.get(ROUTER_SWITCH);
final Map<String, Boolean> routers = new HashMap<>();
for (String router: ROUTERS) {
for (String router : ROUTERS) {
routers.put(router, router.equals(propRouter));
}
additionalProperties.put("routers", routers);
Expand All @@ -244,7 +244,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod"));
supportingFiles.add(new SupportingFile("routers.mustache", sourceFolder, "routers.go"));
supportingFiles.add(new SupportingFile("logger.mustache", sourceFolder, "logger.go"));
supportingFiles.add(new SupportingFile("impl.mustache",sourceFolder, "impl.go"));
supportingFiles.add(new SupportingFile("impl.mustache", sourceFolder, "impl.go"));
supportingFiles.add(new SupportingFile("helpers.mustache", sourceFolder, "helpers.go"));
supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go"));
supportingFiles.add(new SupportingFile("error.mustache", sourceFolder, "error.go"));
Expand Down