From 95ba31879b6b65f46a57f2ca510ce0ce6e860c9e Mon Sep 17 00:00:00 2001 From: Luis Madrigal <599908+Madrigal@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:35:31 -0500 Subject: [PATCH] Change defaults when generating a client via smithy CLI (#558) * Change defaults when generating a client via smithy CLI --- codegen/smithy-go-codegen-test/smithy-build.json | 4 ++-- .../java/software/amazon/smithy/go/codegen/GoModuleInfo.java | 2 +- .../java/software/amazon/smithy/go/codegen/GoSettings.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codegen/smithy-go-codegen-test/smithy-build.json b/codegen/smithy-go-codegen-test/smithy-build.json index 98ca09632..a2e1635bc 100644 --- a/codegen/smithy-go-codegen-test/smithy-build.json +++ b/codegen/smithy-go-codegen-test/smithy-build.json @@ -6,14 +6,14 @@ "module": "github.com/aws/smithy-go/internal/tests/service/weather", "moduleVersion": "0.0.1", "generateGoMod": true, - "goDirective": "1.18" + "goDirective": "1.21" }, "go-server-codegen": { "service": "example.weather#Weather", "module": "github.com/aws/smithy-go/internal/tests/server/weather", "moduleVersion": "0.0.1", "generateGoMod": true, - "goDirective": "1.18" + "goDirective": "1.21" } } } diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoModuleInfo.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoModuleInfo.java index 881ccf7d1..339be9f57 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoModuleInfo.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoModuleInfo.java @@ -27,7 +27,7 @@ public final class GoModuleInfo { - public static final String DEFAULT_GO_DIRECTIVE = "1.15"; + public static final String DEFAULT_GO_DIRECTIVE = "1.21"; private List dependencies; diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java index b207f4728..4ac649fe0 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java @@ -92,7 +92,7 @@ public static GoSettings from(ObjectNode config, ArtifactType artifactType) { settings.setModuleDescription(config.getStringMemberOrDefault( MODULE_DESCRIPTION, settings.getModuleName() + " client")); settings.setModuleVersion(config.getStringMemberOrDefault(MODULE_VERSION, null)); - settings.setGenerateGoMod(config.getBooleanMemberOrDefault(GENERATE_GO_MOD, false)); + settings.setGenerateGoMod(config.getBooleanMemberOrDefault(GENERATE_GO_MOD, true)); settings.setGoDirective(config.getStringMemberOrDefault(GO_DIRECTIVE, GoModuleInfo.DEFAULT_GO_DIRECTIVE)); return settings; }