Help us shape the future of Go! Take the 2026 Go Developer Survey

testhome

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package testhome keeps a package's tests off the developer's machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(m *testing.M, env ...string)

Main runs m with $HOME and the XDG base directories pointed at a fresh temp directory, so no test reads or writes the real ~/.config/ask or ~/.claude — or the developer's config steers a test at a real model — by accident. A test that needs a home of its own still sets one with t.Setenv. env adds further variables for the whole run, as key, value pairs.

func NoClaude

func NoClaude() []string

NoClaude is the env pair that points the Claude Code provider at a binary that does not exist, so a test that reaches it (a model listing over the real registry) fails fast instead of starting the real CLI.

func UseRealHome

func UseRealHome(t *testing.T)

UseRealHome points $HOME back at the developer's own for one test. Only opt-in tests that deliberately drive real tools use it — the claude CLI finds its login there.

Types

This section is empty.

Jump to

Keyboard shortcuts

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