Package magic will determine the type of file based on the first "magic bytes". The file signatures are not complete, but represent some of the most common file types.
type FileInfo struct {
// Name of the file
Name string
// Comma delimited list of known extensions for this file type
Ext []string
// Description of the file
Description string
// Size of the file in bytes
Size int64
}
FileInfo struct
func FileBytes(file string) (FileInfo, error)
FileBytes returns a FileInfo struct. The error will be non-nil if the file type cannot be determined or if the file cannot be read.
Generated by godoc2md