fixup: BOM Trim -> TrimPrefix

This commit is contained in:
Cameron Sparr 2016-06-24 08:47:31 +01:00
parent f62c493c77
commit 755b2ec953
1 changed files with 2 additions and 2 deletions

View File

@ -542,8 +542,8 @@ func (c *Config) LoadConfig(path string) error {
// trimBOM trims the Byte-Order-Marks from the beginning of the file.
// this is for Windows compatability only.
// see https://github.com/influxdata/telegraf/issues/1378
func trimBOM(fileBytes []byte) []byte {
return bytes.Trim(fileBytes, "\xef\xbb\xbf")
func trimBOM(f []byte) []byte {
return bytes.TrimPrefix(f, []byte("\xef\xbb\xbf"))
}
// parseFile loads a TOML configuration from a provided path and