Skip to content

Instantly share code, notes, and snippets.

@jaypozo
Created September 18, 2014 16:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jaypozo/eaf13f7ecfec68b408cf to your computer and use it in GitHub Desktop.
Save jaypozo/eaf13f7ecfec68b408cf to your computer and use it in GitHub Desktop.
Remove BOM in golang
def trapBOM(fileBytes []byte) []byte{
trimmedBytes := bytes.Trim(fileBytes, "\xef\xbb\xbf")
return trimmedBytes
}
@dimchansky
Copy link

@beta
Copy link

beta commented Aug 23, 2018

Apparently it should be func instead of def.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment