Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove BOM in golang
def trapBOM(fileBytes []byte) []byte{
trimmedBytes := bytes.Trim(fileBytes, "\xef\xbb\xbf")
return trimmedBytes
Copy link

dimchansky commented Mar 29, 2017

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