dedent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dedent provides a utility for dedenting multiline strings.

This package is really useful for providing multiline string literals as inputs to cobra commands in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lines

func Lines(lines ...string) []string

Lines dedents a slice of strings and returns the result as a slice of strings with the common prefix whitespace removed. This will also trim any leading and trailing whitespace lines.

func String

func String(s string) string

String dedents a multiline string and returns the result as a string without any common prefix whitespace. This will also trim and remove any leading and trailing whitespace lines.

func Strings

func Strings(lines ...string) string

Strings dedents a slice of strings and returns the result as a single string with the common prefix whitespace removed. This will also trim any leading

Types

This section is empty.

Jump to

Keyboard shortcuts

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