tips

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Package tips provides utilities for displaying helpful tips to users during specific workflows. Tips are informational messages that can help users troubleshoot issues or learn about features.

Tips can be disabled globally using --no-tips or individually using --no-tip <tip-name>.

Index

Constants

View Source
const (
	// DebuggingDocs is the tip that points users to the debugging documentation.
	DebuggingDocs = "debugging-docs"

	// WindowsSymlinkWarning is the tip that warns Windows users about symlinks.
	WindowsSymlinkWarning = "windows-symlink-warning"

	// WindowsSymlinkWarningMessage is the default message for the Windows symlink warning tip.
	WindowsSymlinkWarningMessage = "Windows users may encounter silent fallback behavior to provider copying " +
		"instead of symlinking in OpenTofu/Terraform. " +
		"See https://github.com/gruntwork-io/terragrunt/issues/5061 for more information."

	// WindowsSymlinkWarningOpenTofuMessage is the OpenTofu-specific message for the Windows symlink warning tip,
	// shown when the user is running OpenTofu >= 1.12.0.
	WindowsSymlinkWarningOpenTofuMessage = "Windows users may encounter silent fallback from symlinking to " +
		"copying for provider plugins. " +
		"Set TF_LOG=warn to check if OpenTofu is falling back to copying. " +
		"See https://github.com/gruntwork-io/terragrunt/issues/5061 for more information."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidTipNameError

type InvalidTipNameError struct {
	// contains filtered or unexported fields
}

InvalidTipNameError is an error that is returned when an invalid tip name is requested.

func NewInvalidTipNameError

func NewInvalidTipNameError(requestedName string, allowedNames []string) *InvalidTipNameError

func (InvalidTipNameError) Error

func (err InvalidTipNameError) Error() string

func (InvalidTipNameError) Is

func (err InvalidTipNameError) Is(target error) bool

type Tip

type Tip struct {
	// Name is a unique identifier for the tip
	Name string
	// Message is the message to display when the tip is triggered
	Message string
	// OnceShow is a sync.Once to ensure the tip is only shown once per session
	OnceShow sync.Once
	// contains filtered or unexported fields
}

Tip represents a helpful tip displayed to users.

func (*Tip) Disable

func (tip *Tip) Disable()

Disable disables this tip from being shown.

func (*Tip) Evaluate

func (tip *Tip) Evaluate(l log.Logger)

Evaluate displays the tip if not disabled and not already shown.

type Tips

type Tips []*Tip

Tips is a collection of Tip pointers.

func NewTips

func NewTips() Tips

NewTips returns a new Tips collection with all available tips.

Never remove any of these tips, as removing them will cause a breaking change for users using an invocation of `--no-tip` pointing to a non-existent tip.

e.g. `terragrunt run --no-tip=debugging-docs`

If you want to programmatically document that a tip should no longer be used after removing it from the codebase, just set `disabled` to `1` here for that tip.

func (Tips) DisableAll

func (t Tips) DisableAll()

DisableAll disables all tips such that they aren't shown.

func (Tips) DisableTip

func (t Tips) DisableTip(name string) error

DisableTip validates that the specified tip name is valid and disables this tip.

func (Tips) Find

func (t Tips) Find(name string) *Tip

Find searches and returns the tip by the given `name`.

func (Tips) Names

func (t Tips) Names() []string

Names returns all tip names.

Jump to

Keyboard shortcuts

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