drivertest

package
v0.0.0-...-68c7731 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

The drivertest package provides a fake implementation of the go/packages driver protocol that delegates to the go list driver. It may be used to test programs such as gopls that specialize behavior when a go/packages driver is in use.

The driver is run as a child of the current process, by calling RunIfChild at process start, and running go/packages with the environment variables set by Env.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(t interface{ Fatal(...any) }) []string

Env returns additional environment variables for use in packages.Config to enable the use of drivertest as the driver.

t abstracts a *testing.T or log.Default().

func RunIfChild

func RunIfChild()

RunIfChild runs the current process as a go/packages driver, if configured to do so by the current environment (see Env).

Otherwise, RunIfChild is a no op.

Types

This section is empty.

Jump to

Keyboard shortcuts

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