// DetectBom detect bom of file as the path
// returns true and content of byte array as file after remove the bom
DetectBom detect bom of file as the path
returns true and content of byte array as file after remove the bom
// DetectBom detect bom of file as the path // returns true and content of byte array as file after remove the bom
func DetectBom(path string) (bool, []byte, error) {
	isRegularFile, err := IsRugular(path)
	if err != nil {
		return false, nil, err
	}
	if isRegularFile { 
		data, err := ioutil.ReadFile(path)
		if err != nil {
			return false, nil, err
		}
		output, err := RemoveUtfBom(data)
		if err != nil {
			return false, nil, err
		}
		if bytes.Compare(output, data) != 0 {
			return true, output, nil
		}
	}
	return false, nil, nil
}
func DetectBom ( path string ) ( bool , [ ] byte , error ) { isRegularFile , err := IsRugular ( path ) if err != nil { return false , nil , err } if isRegularFile { data , err := ioutil . ReadFile ( path ) if err != nil { return false , nil , err } output , err := RemoveUtfBom ( data ) if err != nil { return false , nil , err } if bytes . Compare ( output , data ) != 0 { return true , output , nil } } return false , nil , nil }
DetectBom detect bom of file as the path
returns true and content of byte array as file after remove the bom
DetectBom detect bom of file as the path returns true and content of byte array as file after remove the bom
// regular file