internal

package
v0.260225.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: 0BSD Imports: 13 Imported by: 0

Documentation

Overview

Package internal contains internal helper functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detab

func Detab(s string) string

Detab removes the leading tab characters from the string if it's a multiline string. That's because efftesting uses backticks for multiline strings and tab indents them.

Types

type Location

type Location struct {
	Fname string
	Line  int
}

Location represents a line in a file. The filename is absolute.

func (Location) String

func (loc Location) String() string

type Replacer

type Replacer struct {
	sync.Mutex
	Replacements map[Location]string
	Incomplete   map[Location]bool
}

Replacer contains the new expectations for a set of locations.

func (*Replacer) Apply

func (r *Replacer) Apply(fname string) error

Apply applies are stored replacements to a given file.

func (*Replacer) ApplyAll

func (r *Replacer) ApplyAll() error

ApplyAll applies all replacements to all files.

func (*Replacer) Replace

func (r *Replacer) Replace(newstr string) Location

Replace marks the current caller's location to be replaced with newstr.

Jump to

Keyboard shortcuts

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