Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Go 1.23 #1218

Merged
merged 5 commits into from
Nov 13, 2024
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
1 change: 1 addition & 0 deletions docs/pages/docs/providers/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 3 additions & 0 deletions examples/go-v123/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module hello-world

go 1.23
7 changes: 7 additions & 0 deletions examples/go-v123/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("Hello from Go!")
}
5 changes: 5 additions & 0 deletions src/providers/go.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ 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";
Expand Down
52 changes: 52 additions & 0 deletions tests/snapshots/generate_plan_tests__go_v123.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading