Jim Myhrberg 5dbdbbf341 fix(bytes): change Bytes function to accept string input but return a byte slice
The old method signature was just nonsensical, as you would always be
providing indented values via a string literal. So it makes much more
sense to have all methods accept a string argument, and then return
different types.

This also allows use of a `Bytesf` method.

This is technically a breaking change, but I'm classifying it as a
bugfix cause the old method signature was basically useless.
2020-12-14 14:52:32 +00:00
2020-12-07 10:48:40 +00:00

undent

Go package which removes leading indentation/white-space from strings and byte slices.

Go Reference GitHub tag (latest SemVer) Actions Status Coverage GitHub issues GitHub pull requests License Status

s := undent.String(`
	{
	  "hello": "world"
	}`,
)
fmt.Println(s)
{
  "hello": "world"
}

Documentation

Please see the Go Reference for documentation and examples.

Benchmarks

Benchmark reports and graphs are available here: https://jimeh.me/undent/dev/bench/

License

MIT

Description
Go package which removes leading indentation/white-space from strings.
Readme MIT 299 KiB
Languages
Go 89.6%
Makefile 10.4%