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)
| 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. |
| 104 | func 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 | } |
no test coverage detected