rwtodd/Go.Sed

Incorrect output with small program

Closed this issue · 2 comments

Simple usage of GNU sed v4.4 on Ubuntu 18.04:

$ echo hello | sed 's|hello|world|'
world

However, go-sed keeps returning an empty string:

image

Looking at your screenshot it looks like you want "sed.New" instead of "sed.NewQuiet". The quiet version is equivalent to running sed with "-n". So if your script has no 'p' commands there will be no output for quiet engines.

You're totally right. Changed it to using sed.New and it worked without a hitch. Thanks!