Skip to content

Commit

Permalink
fixup: BOM Trim -> TrimPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc committed Jun 24, 2016
1 parent f62c493 commit 755b2ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 755b2ec

Please sign in to comment.