From 28b447423cd021a6d0afc226fbba395831ff8a23 Mon Sep 17 00:00:00 2001 From: Faraz Patankar Date: Wed, 13 Nov 2024 09:54:29 +0400 Subject: [PATCH 1/5] add support for go 1.23 --- src/providers/go.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/providers/go.rs b/src/providers/go.rs index 50f90275b..a1759f0fc 100644 --- a/src/providers/go.rs +++ b/src/providers/go.rs @@ -35,6 +35,7 @@ const AVAILABLE_GO_VERSIONS: &[(&str, &str, &str)] = &[ "1f13eabcd6f5b00fe9de9575ac52c66a0e887ce6", ), ("1.22", "go", "e89cf1c932006531f454de7d652163a9a5c86668"), + ("1.23", "go_1_23", "05bbf675397d5366259409139039af8077d695ce"), ]; const DEFAULT_GO_PKG_NAME: &str = "go"; const DEFAULT_ARCHIVE: &str = "e89cf1c932006531f454de7d652163a9a5c86668"; From 8d5eb4043f604d54914cfcd73b74f72b9499c06a Mon Sep 17 00:00:00 2001 From: Faraz Patankar Date: Wed, 13 Nov 2024 09:54:38 +0400 Subject: [PATCH 2/5] add an example using go 1.23 --- examples/go-v123/go.mod | 3 +++ examples/go-v123/main.go | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 examples/go-v123/go.mod create mode 100644 examples/go-v123/main.go diff --git a/examples/go-v123/go.mod b/examples/go-v123/go.mod new file mode 100644 index 000000000..f2780549b --- /dev/null +++ b/examples/go-v123/go.mod @@ -0,0 +1,3 @@ +module hello-world + +go 1.23 diff --git a/examples/go-v123/main.go b/examples/go-v123/main.go new file mode 100644 index 000000000..9ca930265 --- /dev/null +++ b/examples/go-v123/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello from Go!") +} From f4a7911910ecd2a9d03a34275dabb71ab95ae42a Mon Sep 17 00:00:00 2001 From: Faraz Patankar Date: Wed, 13 Nov 2024 09:57:21 +0400 Subject: [PATCH 3/5] update docs --- docs/pages/docs/providers/go.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/docs/providers/go.md b/docs/pages/docs/providers/go.md index e86523810..2ecb5d3ca 100644 --- a/docs/pages/docs/providers/go.md +++ b/docs/pages/docs/providers/go.md @@ -19,6 +19,7 @@ The following Go versions are available: - `1.20` - `1.21` - `1.22` (default) +- `1.23` The version is parsed from the `go.mod` file. From dbafdb6acc04c5ee3d52b8c71676e560ee3c3ca3 Mon Sep 17 00:00:00 2001 From: Faraz Patankar Date: Wed, 13 Nov 2024 10:02:45 +0400 Subject: [PATCH 4/5] fmt --- src/providers/go.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/providers/go.rs b/src/providers/go.rs index a1759f0fc..230f9ebe7 100644 --- a/src/providers/go.rs +++ b/src/providers/go.rs @@ -35,7 +35,11 @@ const AVAILABLE_GO_VERSIONS: &[(&str, &str, &str)] = &[ "1f13eabcd6f5b00fe9de9575ac52c66a0e887ce6", ), ("1.22", "go", "e89cf1c932006531f454de7d652163a9a5c86668"), - ("1.23", "go_1_23", "05bbf675397d5366259409139039af8077d695ce"), + ( + "1.23", + "go_1_23", + "05bbf675397d5366259409139039af8077d695ce", + ), ]; const DEFAULT_GO_PKG_NAME: &str = "go"; const DEFAULT_ARCHIVE: &str = "e89cf1c932006531f454de7d652163a9a5c86668"; From 7685d61838e24a6f0f7cf4857717a21f96ef3200 Mon Sep 17 00:00:00 2001 From: Faraz Patankar Date: Wed, 13 Nov 2024 10:18:30 +0400 Subject: [PATCH 5/5] add go 1.23 snapshot --- .../generate_plan_tests__go_v123.snap | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/snapshots/generate_plan_tests__go_v123.snap diff --git a/tests/snapshots/generate_plan_tests__go_v123.snap b/tests/snapshots/generate_plan_tests__go_v123.snap new file mode 100644 index 000000000..3c8f57eab --- /dev/null +++ b/tests/snapshots/generate_plan_tests__go_v123.snap @@ -0,0 +1,52 @@ +--- +source: tests/generate_plan_tests.rs +expression: plan +snapshot_kind: text +--- +{ + "providers": [], + "buildImage": "[build_image]", + "variables": { + "CGO_ENABLED": "0", + "NIXPACKS_METADATA": "go" + }, + "phases": { + "build": { + "name": "build", + "dependsOn": [ + "install", + "setup" + ], + "cmds": [ + "go build -o out" + ], + "cacheDirectories": [ + "/root/.cache/go-build" + ] + }, + "install": { + "name": "install", + "dependsOn": [ + "setup" + ], + "cmds": [ + "go mod download" + ], + "cacheDirectories": [ + "/root/.cache/go-build" + ] + }, + "setup": { + "name": "setup", + "nixPkgs": [ + "go_1_23" + ], + "nixOverlays": [], + "nixpkgsArchive": "[archive]" + } + }, + "start": { + "cmd": "./out", + "runImage": "ubuntu:jammy" + } +}