Skip to content

Commit

Permalink
Remove newlines from YAML error
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lytvynov committed Dec 7, 2020
1 parent e2eaa3d commit a704fc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/config/fileconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package config
import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"io"
"io/ioutil"
Expand Down Expand Up @@ -256,6 +257,8 @@ func ReadConfig(reader io.Reader) (*FileConfig, error) {
}
return &fc, nil
}
// Remove all newlines in the YAML error, to avoid escaping when printing.
strictUnmarshalErr = errors.New(strings.Replace(strictUnmarshalErr.Error(), "\n", "", -1))
// DELETE IN 7.0: during 6.0, users should notice any issues that passed
// old validation but not the new strict one. With 7.0, we should always
// enforce the strict validation.
Expand Down

0 comments on commit a704fc2

Please sign in to comment.