MCPcopy Index your code
hub / github.com/docker/cli / TestSetGoDebug

Function TestSetGoDebug

cli/command/cli_test.go:353–372  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

351}
352
353func TestSetGoDebug(t *testing.T) {
354 t.Run("GODEBUG already set", func(t *testing.T) {
355 t.Setenv("GODEBUG", "val1,val2")
356 meta := store.Metadata{}
357 setGoDebug(meta)
358 assert.Equal(t, "val1,val2", os.Getenv("GODEBUG"))
359 })
360 t.Run("GODEBUG in context metadata can set env", func(t *testing.T) {
361 t.Setenv("GODEBUG", "")
362 meta := store.Metadata{
363 Metadata: DockerContext{
364 AdditionalFields: map[string]any{
365 "GODEBUG": "val1,val2=1",
366 },
367 },
368 }
369 setGoDebug(meta)
370 assert.Equal(t, "val1,val2=1", os.Getenv("GODEBUG"))
371 })
372}
373
374func TestNewDockerCliWithCustomUserAgent(t *testing.T) {
375 var received string

Callers

nothing calls this directly

Calls 1

setGoDebugFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…