Skip to content

Commit 2e16ca8

Browse files
kartikjoshi21cpuguy83
authored andcommitted
update go mod
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
1 parent 33a5ba7 commit 2e16ca8

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ require (
3030
go.opentelemetry.io/otel/sdk v1.43.0
3131
golang.org/x/crypto v0.49.0
3232
golang.org/x/exp v0.0.0-20250911091902-df9299821621
33+
golang.org/x/mod v0.33.0
3334
golang.org/x/sync v0.20.0
3435
golang.org/x/tools v0.42.0
3536
google.golang.org/grpc v1.80.0
@@ -96,7 +97,6 @@ require (
9697
go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect
9798
go.opentelemetry.io/otel/trace v1.43.0 // indirect
9899
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
99-
golang.org/x/mod v0.33.0 // indirect
100100
golang.org/x/net v0.52.0 // indirect
101101
golang.org/x/sys v0.42.0 // indirect
102102
golang.org/x/text v0.35.0 // indirect

test/linux_target_test.go

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,67 @@ func main() {
21992199
})
22002200
})
22012201

2202+
t.Run("gomod replace directive incompatible version", func(t *testing.T) {
2203+
t.Parallel()
2204+
ctx := startTestSpan(baseCtx, t)
2205+
2206+
spec := &dalec.Spec{
2207+
Name: "test-gomod-replace-incompatible",
2208+
Version: "0.0.1",
2209+
Revision: "1",
2210+
License: "MIT",
2211+
Website: "https://github.com/project-dalec/dalec",
2212+
Vendor: "Dalec",
2213+
Packager: "Dalec",
2214+
Description: "Testing gomod replace directive with in-compatible version",
2215+
Sources: map[string]dalec.Source{
2216+
"src": {
2217+
Inline: &dalec.SourceInline{
2218+
Dir: &dalec.SourceInlineDir{
2219+
Files: map[string]*dalec.SourceInlineFile{
2220+
"go.mod": {Contents: "module example.com/test\n\ngo 1.18\n\nrequire github.com/docker/cli v29.2.1+incompatible\n"},
2221+
"main.go": {Contents: `package main
2222+
2223+
import _ "github.com/docker/cli/pkg/kvfile"
2224+
2225+
func main() {}
2226+
`},
2227+
},
2228+
},
2229+
},
2230+
Generate: []*dalec.SourceGenerator{
2231+
{
2232+
Gomod: &dalec.GeneratorGomod{
2233+
Edits: &dalec.GomodEdits{
2234+
Replace: []dalec.GomodReplace{
2235+
{Original: "github.com/docker/cli", Update: "github.com/docker/cli@v29.2.1"},
2236+
},
2237+
},
2238+
},
2239+
},
2240+
},
2241+
},
2242+
},
2243+
Dependencies: &dalec.PackageDependencies{
2244+
Build: map[string]dalec.PackageConstraints{
2245+
testConfig.GetPackage("golang"): {},
2246+
},
2247+
},
2248+
Build: dalec.ArtifactBuild{
2249+
Steps: []dalec.BuildStep{
2250+
{Command: "grep -F 'replace github.com/docker/cli => github.com/docker/cli v29.2.1+incompatible' ./src/go.mod"},
2251+
{Command: "[ -d \"${GOMODCACHE}/github.com/docker/cli@v29.2.1+incompatible\" ]"},
2252+
{Command: "cd ./src && go build"},
2253+
},
2254+
},
2255+
}
2256+
2257+
testEnv.RunTest(ctx, t, func(ctx context.Context, client gwclient.Client) {
2258+
req := newSolveRequest(withBuildTarget(testConfig.Target.Package), withSpec(ctx, t, spec))
2259+
solveT(ctx, t, client, req)
2260+
})
2261+
})
2262+
22022263
t.Run("gomod multi-module with paths", func(t *testing.T) {
22032264
t.Parallel()
22042265
ctx := startTestSpan(baseCtx, t)

0 commit comments

Comments
 (0)