Skip to content

Git designed for AI agents.

207 B
Raw Blame
package text

import (
	"bytes"
)

// ChompBytes converts b to a string with its trailing newline, if present, removed.
func ChompBytes(b []byte) string {
	return string(bytes.TrimSuffix(b, []byte{'\n'}))
}