Skip to content

Introduce text.ChompBytes helper

Jacob Vosmaer requested to merge chomp-bytes into master

We keep repeating the pattern of "convert []byte to string, remove trailing newline". This MR introduces a helper for it. The name is based on Ruby's String#chomp, which probably goes back to Perl's chomp (and where did Perl get it from?).

I don't think I caught all places where this is useful, but I probably caught most of them.

I also found a bug in some test code that I fixed while I was there.

Edited by GitLab Release Tools Bot

Merge request reports