dedent

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dedent: https://github.com/lithammer/dedent

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dedent

func Dedent(s string) string

Dedent removes any common leading whitespace from every line in s.

This can be used to make multiline strings to line up with the left edge of the display, while still presenting them in the source code in indented form.

Example
fmt.Println(Dedent(`Lorem ipsum dolor sit amet,
		consectetur adipiscing elit.
		Curabitur justo tellus, facilisis nec efficitur dictum,
		fermentum vitae ligula. Sed eu convallis sapien.`))
Output:

Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Curabitur justo tellus, facilisis nec efficitur dictum,
fermentum vitae ligula. Sed eu convallis sapien.

func Sprintf

func Sprintf(format string, a ...any) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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