envtest

package
v1.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package envtest holds tiny, dependency-free helpers shared by TestMain functions across packages. It intentionally imports nothing from this repo so it can be used from internal test files (package foo, not foo_test) without risking an import cycle back into the package under test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearAmbientGitHubTokenEnv

func ClearAmbientGitHubTokenEnv() (restore func())

ClearAmbientGitHubTokenEnv clears GITHUB_TOKEN/GH_TOKEN for the life of a TestMain run and returns a func to restore their original values afterward. Without this, a developer machine's or CI runner's ambient token can leak into UserPRCache and trigger a real, unmocked dial to the GitHub API mid-test-suite.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL