diff --git a/CHANGELOG.md b/CHANGELOG.md index c8bfc7d76..fca30b6b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - chore: lint example test [#656](https://github.com/hypermodeinc/modus/pull/656) - fix: unused imports should not be included in metadata [#657](https://github.com/hypermodeinc/modus/pull/657) +- fix: improve Go version handling [#660](https://github.com/hypermodeinc/modus/pull/660) ## 2024-12-13 - Runtime 0.15.0 diff --git a/cli/src/commands/new/index.ts b/cli/src/commands/new/index.ts index fa8175264..30cd6d170 100644 --- a/cli/src/commands/new/index.ts +++ b/cli/src/commands/new/index.ts @@ -321,14 +321,19 @@ export default class NewCommand extends BaseCommand { // Apply SDK-specific modifications const execOpts = { env: process.env, cwd: dir, shell: true }; switch (sdk) { - case SDK.AssemblyScript: + case SDK.AssemblyScript: { await execFile("npm", ["pkg", "set", `name=${name}`], execOpts); await execFile("npm", ["install"], execOpts); break; - case SDK.Go: + } + case SDK.Go: { + const goVersion = await getGoVersion(); + await execFile("go", ["mod", "edit", "-go", goVersion!], execOpts); await execFile("go", ["mod", "edit", "-module", name], execOpts); await execFile("go", ["mod", "download"], execOpts); + await execFile("go", ["mod", "tidy"], execOpts); break; + } } if (createGitRepo) { diff --git a/cli/src/custom/globals.ts b/cli/src/custom/globals.ts index 85248877a..30d795ccc 100644 --- a/cli/src/custom/globals.ts +++ b/cli/src/custom/globals.ts @@ -14,7 +14,7 @@ import process from "node:process"; export const ModusHomeDir = process.env.MODUS_HOME || path.join(os.homedir(), ".modus"); export const MinNodeVersion = "22.0.0"; -export const MinGoVersion = "1.23.0"; +export const MinGoVersion = "1.23.1"; export const MinTinyGoVersion = "0.33.0"; export const GitHubOwner = "hypermodeinc"; diff --git a/runtime/languages/golang/testdata/go.mod b/runtime/languages/golang/testdata/go.mod index 6d7f0080a..5c5a5350b 100644 --- a/runtime/languages/golang/testdata/go.mod +++ b/runtime/languages/golang/testdata/go.mod @@ -1,5 +1,5 @@ module testdata -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/anthropic-functions/go.mod b/sdk/go/examples/anthropic-functions/go.mod index cad435407..ec4eb3b14 100644 --- a/sdk/go/examples/anthropic-functions/go.mod +++ b/sdk/go/examples/anthropic-functions/go.mod @@ -1,6 +1,6 @@ module anthropic-functions-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/auth/go.mod b/sdk/go/examples/auth/go.mod index 891beb81f..ba27bd2ce 100644 --- a/sdk/go/examples/auth/go.mod +++ b/sdk/go/examples/auth/go.mod @@ -1,5 +1,5 @@ module auth-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/classification/go.mod b/sdk/go/examples/classification/go.mod index 08b8e2888..3684b5b7d 100644 --- a/sdk/go/examples/classification/go.mod +++ b/sdk/go/examples/classification/go.mod @@ -1,5 +1,5 @@ module classification-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/collections/go.mod b/sdk/go/examples/collections/go.mod index 87676cf77..18c1634aa 100644 --- a/sdk/go/examples/collections/go.mod +++ b/sdk/go/examples/collections/go.mod @@ -1,5 +1,5 @@ module collection-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/dgraph/go.mod b/sdk/go/examples/dgraph/go.mod index 06aa740f7..bd0fe8ebd 100644 --- a/sdk/go/examples/dgraph/go.mod +++ b/sdk/go/examples/dgraph/go.mod @@ -1,5 +1,5 @@ module dgraph-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/embedding/go.mod b/sdk/go/examples/embedding/go.mod index c7ebba2c3..225a17389 100644 --- a/sdk/go/examples/embedding/go.mod +++ b/sdk/go/examples/embedding/go.mod @@ -1,6 +1,6 @@ module embedding-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/graphql/go.mod b/sdk/go/examples/graphql/go.mod index ed6e3cdbd..d90e2da08 100644 --- a/sdk/go/examples/graphql/go.mod +++ b/sdk/go/examples/graphql/go.mod @@ -1,5 +1,5 @@ module graphql-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/http/go.mod b/sdk/go/examples/http/go.mod index aa60f6c42..3dfaa53ab 100644 --- a/sdk/go/examples/http/go.mod +++ b/sdk/go/examples/http/go.mod @@ -1,5 +1,5 @@ module http-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/neo4j/go.mod b/sdk/go/examples/neo4j/go.mod index 43bea0e4a..80987f5d6 100644 --- a/sdk/go/examples/neo4j/go.mod +++ b/sdk/go/examples/neo4j/go.mod @@ -1,5 +1,5 @@ module neo4j-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/postgresql/go.mod b/sdk/go/examples/postgresql/go.mod index 156538e19..25a5b96fc 100644 --- a/sdk/go/examples/postgresql/go.mod +++ b/sdk/go/examples/postgresql/go.mod @@ -1,5 +1,5 @@ module postgresql-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/simple/go.mod b/sdk/go/examples/simple/go.mod index 14db7d750..8aff5e6dd 100644 --- a/sdk/go/examples/simple/go.mod +++ b/sdk/go/examples/simple/go.mod @@ -1,5 +1,5 @@ module simple-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/textgeneration/go.mod b/sdk/go/examples/textgeneration/go.mod index 7d43366c8..78aec5b82 100644 --- a/sdk/go/examples/textgeneration/go.mod +++ b/sdk/go/examples/textgeneration/go.mod @@ -1,6 +1,6 @@ module text-generation-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/examples/vectors/go.mod b/sdk/go/examples/vectors/go.mod index 9007039ed..084f8bd5a 100644 --- a/sdk/go/examples/vectors/go.mod +++ b/sdk/go/examples/vectors/go.mod @@ -1,6 +1,6 @@ module vectors-example -go 1.23.0 +go 1.23.4 require github.com/hypermodeinc/modus/sdk/go v0.15.0 diff --git a/sdk/go/go.mod b/sdk/go/go.mod index a181d7720..549b5a211 100644 --- a/sdk/go/go.mod +++ b/sdk/go/go.mod @@ -1,6 +1,6 @@ module github.com/hypermodeinc/modus/sdk/go -go 1.23.0 +go 1.23.1 require ( github.com/hypermodeinc/modus/lib/manifest v0.15.0 diff --git a/sdk/go/templates/default/go.mod b/sdk/go/templates/default/go.mod index 2ba48988a..eff5edd9f 100644 --- a/sdk/go/templates/default/go.mod +++ b/sdk/go/templates/default/go.mod @@ -1,5 +1,5 @@ module my-modus-app -go 1.23.0 +go 1.23.1 require github.com/hypermodeinc/modus/sdk/go v0.15.0