MCPcopy
hub / github.com/cli/cli / SetActiveToken

Method SetActiveToken

internal/gh/gh.go:161–161  ·  view source on GitHub ↗

The following methods are only for testing and that is a design smell we should consider fixing. SetActiveToken will override any token resolution and return the given token and source for all calls to ActiveToken. Use for testing purposes only.

(token, source string)

Source from the content-addressed store, hash-verified

159 // ActiveToken.
160 // Use for testing purposes only.
161 SetActiveToken(token, source string)
162
163 // SetHosts will override any hosts resolution and return the given hosts for all calls to Hosts.
164 // Use for testing purposes only.

Callers 7

Test_BaseRepoFunction · 0.95
Test_SmartBaseRepoFunction · 0.95
Test_remoteResolverFunction · 0.95
Test_apiRun_cacheFunction · 0.95
Test_authRecoveryCommandFunction · 0.65

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls

Tested by 7

Test_BaseRepoFunction · 0.76
Test_SmartBaseRepoFunction · 0.76
Test_remoteResolverFunction · 0.76
Test_apiRun_cacheFunction · 0.76
Test_authRecoveryCommandFunction · 0.52