Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save danielnegri/bff4200c49a5439f50051878f6c5b93e to your computer and use it in GitHub Desktop.

Select an option

Save danielnegri/bff4200c49a5439f50051878f6c5b93e 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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment