File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ import (
66 "io"
77 "os"
88 "path/filepath"
9+ "runtime"
910 "testing"
1011
1112 "github.com/docker/cli/cli/command"
1213 "github.com/docker/cli/cli/config"
1314 "github.com/docker/cli/cli/config/configfile"
1415 "github.com/docker/cli/cli/flags"
1516 "github.com/docker/docker/errdefs"
16- "github.com/docker/docker/pkg/homedir"
1717 "gotest.tools/v3/assert"
1818 is "gotest.tools/v3/assert/cmp"
1919)
@@ -57,7 +57,11 @@ func TestUseDefaultWithoutConfigFile(t *testing.T) {
5757 // the _default_ configuration file. If we specify a custom configuration
5858 // file, the CLI produces an error if the file doesn't exist.
5959 tmpHomeDir := t .TempDir ()
60- t .Setenv (homedir .Key (), tmpHomeDir )
60+ if runtime .GOOS == "windows" {
61+ t .Setenv ("USERPROFILE" , tmpHomeDir )
62+ } else {
63+ t .Setenv ("HOME" , tmpHomeDir )
64+ }
6165 configDir := filepath .Join (tmpHomeDir , ".docker" )
6266 configFilePath := filepath .Join (configDir , "config.json" )
6367
You can’t perform that action at this time.
0 commit comments