testutil

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dedent

func Dedent(s string) string

Dedent strips leading tabs from every line of a string, taking a hint of how many tabs should be stripped from the number of consecutive tabs found on the first non-empty line. Dedent also strips one leading blank line if it contains nothing but the linebreak.

If later lines have fewer leading tab characters than the depth we intuited from the first line, then stripping will still only remove tab characters.

Roughly, Dedent is "Do What I Mean" to normalize a heredoc string that contains leading indentation to make it congruent with the surrounding source code.

func DedentBytes

func DedentBytes(bs []byte) []byte

DedentBytes is identically to Dedent, but works on a byte slice.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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