add support for go 1.11

This commit is contained in:
Ajitem Sahasrabuddhe 2019-12-08 13:55:56 +05:30
parent 0ce33c3785
commit 51e2b186d7

View File

@ -75,7 +75,8 @@ func testApp() *App {
func expectFileContent(t *testing.T, file, expected string) {
data, err := ioutil.ReadFile(file)
// Ignore windows line endings
expected = string(bytes.ReplaceAll([]byte(expected), []byte("\r\n"), []byte("\n")))
// TODO: Replace with bytes.ReplaceAll when support for Go 1.11 is dropped
expected = string(bytes.Replace([]byte(expected), []byte("\r\n"), []byte("\n"), -1))
expect(t, err, nil)
expect(t, string(data), expected)
}