Skip to content

Commit dbb3da9

Browse files
feat(go): support go 1.23 and delve 1.23.1
1 parent ce64064 commit dbb3da9

File tree

8 files changed

+51
-474
lines changed

8 files changed

+51
-474
lines changed

go/helper-image/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ARG GOVERSION=1.20
2-
FROM --platform=$BUILDPLATFORM golang:${GOVERSION} as delve
1+
ARG GOVERSION=1.23
2+
FROM --platform=$BUILDPLATFORM golang:${GOVERSION} AS delve
33
ARG BUILDPLATFORM
44
ARG TARGETOS
55
ARG TARGETARCH
66

7-
ARG DELVE_VERSION=1.20.1
7+
ARG DELVE_VERSION=1.23.1
88

99
# Patch delve to make defaults for --check-go-version and --only-same-user
1010
# to be set at build time. We must install patch(1) to apply the patch.

go/helper-image/delve-as-options.patch

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
11
diff --git cmd/dlv/cmds/commands.go cmd/dlv/cmds/commands.go
2-
index 15df5f6..f145330 100644
2+
index b5b7662c..dcdae257 100644
33
--- cmd/dlv/cmds/commands.go
44
+++ cmd/dlv/cmds/commands.go
5-
@@ -46,6 +46,10 @@ var (
6-
apiVersion int
7-
// acceptMulti allows multiple clients to connect to the same server
8-
acceptMulti bool
9-
+ // checkGoVersionDefault sets default for --check-go-version
10-
+ checkGoVersionDefault = "true"
5+
@@ -61,6 +61,8 @@ var (
6+
// checkLocalConnUser is true if the debugger should check that local
7+
// connections come from the same user that started the headless server
8+
checkLocalConnUser bool
119
+ // checkLocalConnUserDefault sets default for --only-same-user
1210
+ checkLocalConnUserDefault = "true"
13-
// addr is the debugging server listen address.
14-
addr string
15-
// initFile is the path to initialization file.
16-
@@ -139,8 +143,8 @@ func New(docCall bool) *cobra.Command {
17-
rootCommand.PersistentFlags().StringVar(&initFile, "init", "", "Init file, executed by the terminal client.")
18-
rootCommand.PersistentFlags().StringVar(&buildFlags, "build-flags", buildFlagsDefault, "Build flags, to be passed to the compiler. For example: --build-flags=\"-tags=integration -mod=vendor -cover -v\"")
11+
// tty is used to provide an alternate TTY for the program you wish to debug.
12+
tty string
13+
// disableASLR is used to disable ASLR
14+
@@ -78,6 +80,8 @@ var (
15+
// used to compile the executable and refuse to work on incompatible
16+
// versions.
17+
checkGoVersion bool
18+
+ // checkGoVersionDefault sets default for --check-go-version
19+
+ checkGoVersionDefault = "true"
20+
21+
// rootCommand is the root of the command tree.
22+
rootCommand *cobra.Command
23+
@@ -158,8 +162,8 @@ func New(docCall bool) *cobra.Command {
24+
must(rootCommand.RegisterFlagCompletionFunc("build-flags", cobra.NoFileCompletions))
1925
rootCommand.PersistentFlags().StringVar(&workingDir, "wd", "", "Working directory for running the program.")
26+
must(rootCommand.MarkPersistentFlagDirname("wd"))
2027
- rootCommand.PersistentFlags().BoolVarP(&checkGoVersion, "check-go-version", "", true, "Exits if the version of Go in use is not compatible (too old or too new) with the version of Delve.")
2128
- rootCommand.PersistentFlags().BoolVarP(&checkLocalConnUser, "only-same-user", "", true, "Only connections from the same user that started this instance of Delve are allowed to connect.")
2229
+ rootCommand.PersistentFlags().BoolVarP(&checkGoVersion, "check-go-version", "", parseBool(checkGoVersionDefault), "Exits if the version of Go in use is not compatible (too old or too new) with the version of Delve.")
2330
+ rootCommand.PersistentFlags().BoolVarP(&checkLocalConnUser, "only-same-user", "", parseBool(checkLocalConnUserDefault), "Only connections from the same user that started this instance of Delve are allowed to connect.")
2431
rootCommand.PersistentFlags().StringVar(&backend, "backend", "default", `Backend selection (see 'dlv help backend').`)
32+
must(rootCommand.RegisterFlagCompletionFunc("backend", cobra.FixedCompletions([]string{"default", "native", "lldb", "rr"}, cobra.ShellCompDirectiveNoFileComp)))
2533
rootCommand.PersistentFlags().StringArrayVarP(&redirects, "redirect", "r", []string{}, "Specifies redirect rules for target process (see 'dlv help redirect')")
26-
rootCommand.PersistentFlags().BoolVar(&allowNonTerminalInteractive, "allow-non-terminal-interactive", false, "Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr")
27-
@@ -1020,3 +1024,14 @@ func parseRedirects(redirects []string) ([3]string, error) {
34+
@@ -1250,3 +1254,14 @@ func must(err error) {
35+
log.Fatal(err)
2836
}
29-
return r, nil
3037
}
3138
+
3239
+// parseBool parses a boolean value represented by a string, and panics if there is an error.

go/skaffold.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,31 @@ profiles:
6262
docker:
6363
buildArgs:
6464
GOVERSION: '1.20'
65+
- op: add
66+
path: /build/artifacts/-
67+
value:
68+
image: go121app
69+
context: test/goapp
70+
docker:
71+
buildArgs:
72+
GOVERSION: '1.21'
73+
- op: add
74+
path: /build/artifacts/-
75+
value:
76+
image: go122app
77+
context: test/goapp
78+
docker:
79+
buildArgs:
80+
GOVERSION: '1.22'
81+
- op: add
82+
path: /build/artifacts/-
83+
value:
84+
image: go123app
85+
context: test/goapp
86+
docker:
87+
buildArgs:
88+
GOVERSION: '1.23'
89+
6590
deploy:
6691
kubectl:
6792
manifests:

go/test/k8s-test-go113.yaml

Lines changed: 0 additions & 91 deletions
This file was deleted.

go/test/k8s-test-go114.yaml

Lines changed: 0 additions & 91 deletions
This file was deleted.

go/test/k8s-test-go115.yaml

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)