When a string has lines with no indentation and lines with indentations, the dedented string will remove the first spaces within the line instead of just at the start.
package main
import (
"fmt"
"github.com/muesli/reflow/dedent"
)
func main() {
input := `This is an example
with no shared indent.`
fmt.Println(dedent.String(input))
}
The output will be:
Thisisan example
with no shared indent.
https://go.dev/play/p/Q13CeRD8Tb2
When a string has lines with no indentation and lines with indentations, the dedented string will remove the first spaces within the line instead of just at the start.
The output will be:
https://go.dev/play/p/Q13CeRD8Tb2