From 755b2ec9535a619f67247697649d59176185183f Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Fri, 24 Jun 2016 08:47:31 +0100 Subject: [PATCH] fixup: BOM Trim -> TrimPrefix --- internal/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index b1be77d29..8f7821624 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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