fixup: BOM Trim -> TrimPrefix
This commit is contained in:
parent
f62c493c77
commit
755b2ec953
|
@ -542,8 +542,8 @@ func (c *Config) LoadConfig(path string) error {
|
||||||
// trimBOM trims the Byte-Order-Marks from the beginning of the file.
|
// trimBOM trims the Byte-Order-Marks from the beginning of the file.
|
||||||
// this is for Windows compatability only.
|
// this is for Windows compatability only.
|
||||||
// see https://github.com/influxdata/telegraf/issues/1378
|
// see https://github.com/influxdata/telegraf/issues/1378
|
||||||
func trimBOM(fileBytes []byte) []byte {
|
func trimBOM(f []byte) []byte {
|
||||||
return bytes.Trim(fileBytes, "\xef\xbb\xbf")
|
return bytes.TrimPrefix(f, []byte("\xef\xbb\xbf"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseFile loads a TOML configuration from a provided path and
|
// parseFile loads a TOML configuration from a provided path and
|
||||||
|
|
Loading…
Reference in New Issue