MCPcopy Create free account
hub / github.com/cli/cli / clearConfigEnv

Function clearConfigEnv

internal/debug/config_test.go:104–114  ·  view source on GitHub ↗

clearConfigEnv unsets the debug variables for the test, so cases expecting no override are not affected by the environment running the tests. t.Setenv registers the restore before the variable is unset.

(t *testing.T)

Source from the content-addressed store, hash-verified

102// clearConfigEnv unsets the debug variables for the test, so cases expecting no override are not affected by the
103// environment running the tests. t.Setenv registers the restore before the variable is unset.
104func clearConfigEnv(t *testing.T) {
105 t.Helper()
106 for _, key := range []string{
107 "GH_INTERNAL_AT_EXPIRES_IN",
108 "GH_INTERNAL_RT_EXPIRES_IN",
109 "GH_INTERNAL_DEBUG_REFRESH_TOKEN",
110 } {
111 t.Setenv(key, "")
112 require.NoError(t, os.Unsetenv(key))
113 }
114}

Callers 2

TestConfigFromEnvFunction · 0.85

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected