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

hints

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package hints collects the canonical action IDs a package's Markdown invites a model to call, by rendering the package's own formatters rather than by reading its constants: a hint spelled as a literal at the call site is published exactly like one behind a constant, and a test that reads only the constants cannot see it.

It sits beside testutil rather than inside it because it needs toolutil, and internal/toolutil's own tests use testutil. A non-test import of toolutil from testutil closes that loop and every package in it fails to build its tests with "import cycle not allowed in test", which is what happened the first time this helper was written.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HintedActionIDs

func HintedActionIDs(tb testing.TB, pkgPath string) map[string][]string

HintedActionIDs renders every registered Markdown formatter whose output type is declared in pkgPath, driving each with a populated fixture, and returns the action IDs each rendering invites a model to call, keyed by the output type's name.

A type whose rendering names no action is left out of the result rather than recorded empty, since plenty of formatters write no guidance at all; the caller decides whether finding nothing at all is a failure. The fixture is testutil.FixtureMultiPage because a list formatter writes its guidance only once it has rows, and the zero value would render an empty-collection message with no hints in it.

Registration happens in each package's init, so the caller must already import whatever registers the formatters it expects to see.

Types

This section is empty.

Jump to

Keyboard shortcuts

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