func (d *Decoder) TypeByFile(filename string) (string, error) {
	path := C.CString(filename)
	defer C.free(unsafe.Pointer(path))
	out := C.magic_file(d.db, path)
	if out == nil {
		return "", errors.New(C.GoString(C.magic_error(d.db)))
	}
	return C.GoString(out), nil
}
// TypeByFile looks up for a file's mimetype by its content.
// It uses a magic number database which is described in magic(5).
TypeByFile looks up for a file's mimetype by its content.
It uses a magic number database which is described in magic(5).
// TypeByFile looks up for a file ' s mimetype by its content . // It uses a magic number database which is described in magic ( 5 ) .
func (d *Decoder) TypeByFile(filename string) (string, error) {
	path := C.CString(filename)
	defer C.free(unsafe.Pointer(path))
	out := C.magic_file(d.db, path)
	if out == nil {
		return "", errors.New(C.GoString(C.magic_error(d.db)))
	}
	return C.GoString(out), nil
}
func ( d * Decoder ) TypeByFile ( filename string ) ( string , error ) { path := C . CString ( filename ) defer C . free ( unsafe . Pointer ( path ) ) out := C . magic_file ( d . db , path ) if out == nil { return " " , errors . New ( C . GoString ( C . magic_error ( d . db ) ) ) } return C . GoString ( out ) , nil }
TypeByFile looks up for a file's mimetype by its content.
TypeByFile looks up for a file ' s mimetype by its content .