Best Ginkgo code snippet using onepkg.Stuff
mimetype.go
Source:mimetype.go
1// Copyright (c) 2018, The GoKi Authors. All rights reserved.2// Use of this source code is governed by a BSD-style3// license that can be found in the LICENSE file.4package filecat5import (6 "fmt"7 "mime"8 "path/filepath"9 "strings"10 "github.com/alecthomas/chroma/lexers"11 "github.com/gabriel-vasile/mimetype"12 "github.com/h2non/filetype"13)14// MimeNoChar returns the mime string without any charset15// encoding information, or anything else after a ;16func MimeNoChar(mime string) string {17 if sidx := strings.Index(mime, ";"); sidx > 0 {18 return strings.TrimSpace(mime[:sidx])19 }20 return mime21}22// MimeTop returns the top-level main type category from mime type23// i.e., the thing before the / -- returns empty if no /24func MimeTop(mime string) string {25 if sidx := strings.Index(mime, "/"); sidx > 0 {26 return mime[:sidx]27 }28 return ""29}30// MimeSub returns the sub-level subtype category from mime type31// i.e., the thing after the / -- returns empty if no /32// also trims off any charset encoding stuff33func MimeSub(mime string) string {34 if sidx := strings.Index(MimeNoChar(mime), "/"); sidx > 0 {35 return mime[sidx+1:]36 }37 return ""38}39// MimeFromFile gets mime type from file, using Gabriel Vasile's mimetype40// package, mime.TypeByExtension, the chroma syntax highlighter,41// CustomExtMimeMap, and finally FileExtMimeMap. Use the mimetype package's42// extension mechanism to add further content-based matchers as needed, and43// set CustomExtMimeMap to your own map or call AddCustomExtMime for44// extension-based ones.45func MimeFromFile(fname string) (mtype, ext string, err error) {46 ext = strings.ToLower(filepath.Ext(fname))47 if mtyp, has := ExtMimeMap[ext]; has { // use our map first: very fast!48 return mtyp, ext, nil49 }50 fc := fname[0]51 lc := fname[len(fname)-1]52 if fc == '~' || fc == '%' || fc == '#' || lc == '~' || lc == '%' || lc == '#' {53 return MimeString(Trash), ext, nil54 }55 mtypt, err := filetype.MatchFile(fname) // h2non next -- has good coverage56 ptyp := ""57 isplain := false58 if err == nil {59 mtyp := mtypt.MIME.Value60 ext = mtypt.Extension61 if strings.HasPrefix(mtyp, "text/plain") {62 isplain = true63 ptyp = mtyp64 } else if mtyp == "application/zip" {65 mime, err := mimetype.DetectFile(fname) // can detect zipped types66 if err == nil && mime.String() != "" {67 return mime.String(), mime.Extension(), err68 }69 return mtyp, ext, nil70 } else if mtyp != "" {71 return mtyp, ext, err72 }73 }74 mtyp := mime.TypeByExtension(ext)75 if mtyp != "" {76 return mtyp, ext, nil77 }78 lexer := lexers.Match(fname) // todo: could get start of file and pass to79 // Analyze, but might be too slow..80 if lexer != nil {81 config := lexer.Config()82 if len(config.MimeTypes) > 0 {83 mtyp = config.MimeTypes[0]84 return mtyp, ext, nil85 }86 mtyp := "application/" + strings.ToLower(config.Name)87 return mtyp, ext, nil88 }89 if isplain {90 return ptyp, ext, nil91 }92 return "", ext, fmt.Errorf("filecat.MimeFromFile could not find mime type for ext: %v file: %v", ext, fname)93}94// todo: use this to check against mime types!95// MimeToKindMapInit makes sure the MimeToKindMap is initialized from96// InitMimeToKindMap plus chroma lexer types.97// func MimeToKindMapInit() {98// if MimeToKindMap != nil {99// return100// }101// MimeToKindMap = InitMimeToKindMap102// for _, l := range lexers.Registry.Lexers {103// config := l.Config()104// nm := strings.ToLower(config.Name)105// if len(config.MimeTypes) > 0 {106// mtyp := config.MimeTypes[0]107// MimeToKindMap[mtyp] = nm108// } else {109// MimeToKindMap["application/"+nm] = nm110// }111// }112// }113//////////////////////////////////////////////////////////////////////////////114// Mime types115// ExtMimeMap is the map from extension to mime type, built from AvailMimes116var ExtMimeMap = map[string]string{}117// MimeType contains all the information associated with a given mime type118type MimeType struct {119 Mime string `desc:"mimetype string: type/subtype"`120 Exts []string `desc:"file extensions associated with this file type"`121 Cat Cat `desc:"category of file"`122 Sup Supported `desc:"if supported, the name of the supported file type, else NoSupport"`123}124// CustomMimes can be set by other apps to contain custom mime types that125// go beyond what is in the standard ones, and can also redefine and126// override the standard one127var CustomMimes []MimeType128// AvailMimes is the full list (as a map from mimetype) of available defined mime types129// built from StdMimes (compiled in) and then CustomMimes can override130var AvailMimes map[string]MimeType131// MimeSupported returns the supported type for given mime key,132// or NoSupport if not found or not a supported file type133func MimeSupported(mime string) Supported {134 mt, has := AvailMimes[MimeNoChar(mime)]135 if !has {136 return NoSupport137 }138 return mt.Sup139}140// ExtSupported returns the supported type for given file extension,141// or NoSupport if not found or not a supported file type142func ExtSupported(ext string) Supported {143 mime, has := ExtMimeMap[ext]144 if !has {145 return NoSupport146 }147 mt, has := AvailMimes[mime]148 if !has {149 return NoSupport150 }151 return mt.Sup152}153// SupportedFromFile returns the supported type for given file,154// or NoSupport if not found or not a supported file type155func SupportedFromFile(fname string) Supported {156 mtyp, _, err := MimeFromFile(fname)157 if err != nil {158 return NoSupport159 }160 return MimeSupported(mtyp)161}162// MergeAvailMimes merges the StdMimes and CustomMimes into AvailMimes163// if CustomMimes is updated, then this should be called -- initially164// it just has StdMimes.165// It also builds the ExtMimeMap to map from extension to mime type166// and SupportedMimes map of supported file types onto their full167// mime type entry168func MergeAvailMimes() {169 AvailMimes = make(map[string]MimeType, len(StdMimes)+len(CustomMimes))170 for _, mt := range StdMimes {171 AvailMimes[mt.Mime] = mt172 }173 for _, mt := range CustomMimes {174 AvailMimes[mt.Mime] = mt // overwrite automatically175 }176 ExtMimeMap = make(map[string]string) // start over177 SupportedMimes = make(map[Supported]MimeType)178 for _, mt := range AvailMimes {179 if len(mt.Exts) > 0 { // first pass add only ext guys to support180 for _, ex := range mt.Exts {181 if ex[0] != '.' {182 fmt.Printf("filecat.MergeAvailMimes: ext: %v does not start with a . in type: %v\n", ex, mt.Mime)183 }184 if pmt, has := ExtMimeMap[ex]; has {185 fmt.Printf("filecat.MergeAvailMimes: non-unique ext: %v assigned to mime type: %v AND %v\n", ex, pmt, mt.Mime)186 } else {187 ExtMimeMap[ex] = mt.Mime188 }189 }190 if mt.Sup != NoSupport {191 if hsp, has := SupportedMimes[mt.Sup]; has {192 fmt.Printf("filecat.MergeAvailMimes: more-than-one mimetype has extensions for same supported file type: %v -- one: %v other %v\n", mt.Sup, hsp.Mime, mt.Mime)193 } else {194 SupportedMimes[mt.Sup] = mt195 }196 }197 }198 }199 // second pass to get any supported guys that don't have exts200 for _, mt := range AvailMimes {201 if mt.Sup != NoSupport {202 if _, has := SupportedMimes[mt.Sup]; !has {203 SupportedMimes[mt.Sup] = mt204 }205 }206 }207}208func init() {209 MergeAvailMimes()210}211// http://www.iana.org/assignments/media-types/media-types.xhtml212// https://github.com/mirage/ocaml-magic-mime/blob/master/x-mime.types213// https://www.apt-browse.org/browse/debian/stretch/main/all/mime-support/3.60/file/etc/mime.types214// https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html215// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types216// StdMimes is the full list of standard mime types compiled into our code217// various other maps etc are constructed from it.218// When there are multiple types associated with the same real type, pick one219// to be the canonical one and give it, and *only* it, the extensions!220var StdMimes = []MimeType{221 // Folder222 {"text/directory", nil, Folder, NoSupport},223 // Archive224 {"multipart/mixed", nil, Archive, Multipart},225 {"application/tar", []string{".tar", ".tar.gz", ".tgz", ".taz", ".taZ", ".tar.bz2", ".tz2", ".tbz2", ".tbz", ".tar.lz", ".tar.lzma", ".tlz", ".tar.lzop", ".tar.xz"}, Archive, Tar},226 {"application/x-gtar", nil, Archive, Tar},227 {"application/x-gtar-compressed", nil, Archive, Tar},228 {"application/x-tar", nil, Archive, Tar},229 {"application/zip", []string{".zip"}, Archive, Zip},230 {"application/gzip", []string{".gz"}, Archive, GZip},231 {"application/x-7z-compressed", []string{".7z"}, Archive, SevenZ},232 {"application/x-xz", []string{".xz"}, Archive, Xz},233 {"application/x-bzip", []string{".bz", ".bz2"}, Archive, BZip},234 {"application/x-bzip2", nil, Archive, BZip},235 {"application/x-apple-diskimage", []string{".dmg"}, Archive, Dmg},236 {"application/x-shar", []string{".shar"}, Archive, Shar},237 {"application/x-bittorrent", []string{".torrent"}, Archive, NoSupport},238 {"application/rar", []string{".rar"}, Archive, NoSupport},239 {"application/x-stuffit", []string{".sit", ".sitx"}, Archive, NoSupport},240 {"application/vnd.android.package-archive", []string{".apk"}, Archive, NoSupport},241 {"application/vnd.debian.binary-package", []string{".deb", ".ddeb", ".udeb"}, Archive, NoSupport},242 {"application/x-debian-package", nil, Archive, NoSupport},243 {"application/x-redhat-package-manager", []string{".rpm"}, Archive, NoSupport},244 {"text/x-rpm-spec", nil, Archive, NoSupport},245 // Backup246 {"application/x-trash", []string{".bak", ".old", ".sik"}, Backup, Trash}, // also "~", "%", "#",247 // Code -- use text/ as main instead of application as there are more text248 {"text/x-ada", []string{".adb", ".ads", ".ada"}, Code, Ada},249 {"text/x-asp", []string{".aspx", ".asax", ".ascx", ".ashx", ".asmx", ".axd"}, Code, NoSupport},250 {"text/x-sh", []string{".bash", ".sh"}, Code, Bash},251 {"application/x-sh", nil, Code, Bash},252 {"text/x-c", []string{".c", ".C", ".c++", ".cpp", ".cxx", ".cc", ".h", ".h++", ".hpp", ".hxx", ".hh"}, Code, C},253 {"text/x-csrc", nil, Code, C},254 {"text/x-chdr", nil, Code, C},255 {"text/x-c++hdr", nil, Code, C},256 {"text/x-c++src", nil, Code, C},257 {"text/x-chdr", nil, Code, C},258 {"text/x-cpp", nil, Code, C},259 {"text/x-csh", []string{".csh"}, Code, Csh},260 {"application/x-csh", nil, Code, Csh},261 {"text/x-csharp", []string{".cs"}, Code, CSharp},262 {"text/x-dsrc", []string{".d"}, Code, D},263 {"text/x-diff", []string{".diff", ".patch"}, Code, Diff},264 {"text/x-eiffel", []string{".e"}, Code, Eiffel},265 {"text/x-erlang", []string{".erl", ".hrl", ".escript"}, Code, Erlang}, // note: ".es" conflicts with ecmascript266 {"text/x-forth", []string{".frt"}, Code, Forth}, // note: ".fs" conflicts with fsharp267 {"text/x-fortran", []string{".f", ".F"}, Code, Fortran},268 {"text/x-fsharp", []string{".fs", ".fsi"}, Code, FSharp},269 {"text/x-gosrc", []string{".go"}, Code, Go},270 {"text/x-haskell", []string{".hs", ".lhs"}, Code, Haskell},271 {"text/x-literate-haskell", nil, Code, Haskell}, // todo: not sure if same or not272 {"text/x-java", []string{".java", ".jar"}, Code, Java},273 {"application/java-archive", nil, Code, Java},274 {"application/javascript", []string{".js"}, Code, JavaScript},275 {"application/ecmascript", []string{".es"}, Code, NoSupport},276 {"text/x-common-lisp", []string{".lisp", ".cl", ".el"}, Code, Lisp},277 {"text/elisp", nil, Code, Lisp},278 {"text/x-elisp", nil, Code, Lisp},279 {"application/emacs-lisp", nil, Code, Lisp},280 {"text/x-lua", []string{".lua", ".wlua"}, Code, Lua},281 {"text/x-makefile", nil, Code, Makefile},282 {"text/x-autoconf", nil, Code, Makefile},283 {"text/x-moc", []string{".moc"}, Code, NoSupport},284 {"application/mathematica", []string{".nb", ".nbp"}, Code, Mathematica},285 {"text/x-matlab", nil, Code, Matlab}, // ext conflict: []string{".m"} with objcsrc286 {"text/matlab", nil, Code, Matlab},287 {"text/octave", nil, Code, Matlab},288 {"text/scilab", []string{".sci", ".sce", ".tst"}, Code, NoSupport},289 {"text/x-modelica", []string{".mo"}, Code, NoSupport},290 {"text/x-nemerle", []string{".n"}, Code, NoSupport},291 {"text/x-objcsrc", nil, Code, ObjC}, // ext conflict: []string{".m"} with matlab292 {"text/x-objective-j", nil, Code, NoSupport},293 {"text/x-ocaml", []string{".ml", ".mli", ".mll", ".mly"}, Code, OCaml},294 {"text/x-pascal", []string{".p", ".pas"}, Code, Pascal},295 {"text/x-perl", []string{".pl", ".pm"}, Code, Perl},296 {"text/x-php", []string{".php", ".php3", ".php4", ".php5", ".inc"}, Code, Php},297 {"text/x-prolog", []string{".ecl", ".prolog", ".pro"}, Code, Prolog}, // note: ".pl" conflicts298 {"text/x-python", []string{".py", ".pyc", ".pyo", ".pyw"}, Code, Python},299 {"application/x-python-code", nil, Code, Python},300 {"text/x-rust", []string{".rs"}, Code, Rust},301 {"text/rust", nil, Code, Rust},302 {"text/x-r", []string{".r", ".S", ".R", ".Rhistory", ".Rprofile", ".Renviron"}, Code, R},303 {"text/x-R", nil, Code, R},304 {"text/S-Plus", nil, Code, R},305 {"text/S", nil, Code, R},306 {"text/x-r-source", nil, Code, R},307 {"text/x-r-history", nil, Code, R},308 {"text/x-r-profile", nil, Code, R},309 {"text/x-ruby", []string{".rb"}, Code, Ruby},310 {"application/x-ruby", nil, Code, Ruby},311 {"text/x-scala", []string{".scala"}, Code, Scala},312 {"text/x-tcl", []string{".tcl", ".tk"}, Code, Tcl},313 {"application/x-tcl", nil, Code, Tcl},314 // Doc315 {"text/x-bibtex", []string{".bib"}, Doc, BibTeX},316 {"text/x-tex", []string{".tex", ".ltx", ".sty", ".cls", ".latex"}, Doc, TeX},317 {"application/x-latex", nil, Doc, TeX},318 {"application/x-texinfo", []string{".texinfo", ".texi"}, Doc, Texinfo},319 {"application/x-troff", []string{".t", ".tr", ".roff", ".man", ".me", ".ms"}, Doc, Troff},320 {"application/x-troff-man", nil, Doc, Troff},321 {"application/x-troff-me", nil, Doc, Troff},322 {"application/x-troff-ms", nil, Doc, Troff},323 {"text/html", []string{".html", ".htm", ".shtml", ".xhtml", ".xht"}, Doc, Html},324 {"application/xhtml+xml", nil, Doc, Html},325 {"text/mathml", []string{".mml"}, Doc, NoSupport},326 {"text/css", []string{".css"}, Doc, Css},327 {"text/markdown", []string{".md", ".markdown"}, Doc, Markdown},328 {"text/x-markdown", nil, Doc, Markdown},329 {"application/rtf", []string{".rtf"}, Doc, Rtf},330 {"text/richtext", []string{".rtx"}, Doc, NoSupport},331 {"application/mbox", []string{".mbox"}, Doc, NoSupport},332 {"application/x-rss+xml", []string{".rss"}, Doc, NoSupport},333 {"application/msword", []string{".doc", ".dot", ".docx", ".dotx"}, Doc, MSWord},334 {"application/vnd.ms-word", nil, Doc, MSWord},335 {"application/vnd.openxmlformats-officedocument.wordprocessingml.document", nil, Doc, MSWord},336 {"application/vnd.openxmlformats-officedocument.wordprocessingml.template", nil, Doc, MSWord},337 {"application/vnd.oasis.opendocument.text", []string{".odt", ".odm", ".ott", ".oth", ".sxw", ".sxg", ".stw", ".sxm"}, Doc, OpenText},338 {"application/vnd.oasis.opendocument.text-master", nil, Doc, OpenText},339 {"application/vnd.oasis.opendocument.text-template", nil, Doc, OpenText},340 {"application/vnd.oasis.opendocument.text-web", nil, Doc, OpenText},341 {"application/vnd.sun.xml.writer", nil, Doc, OpenText},342 {"application/vnd.sun.xml.writer.global", nil, Doc, OpenText},343 {"application/vnd.sun.xml.writer.template", nil, Doc, OpenText},344 {"application/vnd.sun.xml.math", nil, Doc, OpenText},345 {"application/vnd.oasis.opendocument.presentation", []string{".odp", ".otp", ".sxi", ".sti"}, Doc, OpenPres},346 {"application/vnd.oasis.opendocument.presentation-template", nil, Doc, OpenPres},347 {"application/vnd.sun.xml.impress", nil, Doc, OpenPres},348 {"application/vnd.sun.xml.impress.template", nil, Doc, OpenPres},349 {"application/vnd.ms-powerpoint", []string{".ppt", ".pps", ".pptx", ".sldx", ".ppsx", ".potx"}, Doc, MSPowerpoint},350 {"application/vnd.openxmlformats-officedocument.presentationml.presentation", nil, Doc, MSPowerpoint},351 {"application/vnd.openxmlformats-officedocument.presentationml.slide", nil, Doc, MSPowerpoint},352 {"application/vnd.openxmlformats-officedocument.presentationml.slideshow", nil, Doc, MSPowerpoint},353 {"application/vnd.openxmlformats-officedocument.presentationml.template", nil, Doc, MSPowerpoint},354 {"application/ms-tnef", nil, Doc, NoSupport},355 {"application/vnd.ms-tnef", nil, Doc, NoSupport},356 {"application/onenote", []string{".one", ".onetoc2", ".onetmp", ".onepkg"}, Doc, NoSupport},357 {"application/pgp-encrypted", []string{".pgp"}, Doc, NoSupport},358 {"application/pgp-keys", []string{".key"}, Doc, NoSupport},359 {"application/pgp-signature", []string{".sig"}, Doc, NoSupport},360 {"application/vnd.amazon.ebook", []string{".azw"}, Doc, EBook},361 {"application/epub+zip", []string{".epub"}, Doc, EPub},362 // Sheet363 {"application/vnd.ms-excel", []string{".xls", ".xlb", ".xlt", ".xlsx", ".xltx"}, Sheet, MSExcel},364 {"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", nil, Sheet, MSExcel},365 {"application/vnd.openxmlformats-officedocument.spreadsheetml.template", nil, Sheet, MSExcel},366 {"application/vnd.oasis.opendocument.spreadsheet", []string{".ods", ".ots", ".sxc", ".stc", ".odf"}, Sheet, OpenSheet},367 {"application/vnd.oasis.opendocument.spreadsheet-template", nil, Sheet, OpenSheet},368 {"application/vnd.oasis.opendocument.formula", nil, Sheet, OpenSheet}, // todo: could be separate369 {"application/vnd.sun.xml.calc", nil, Sheet, OpenSheet},370 {"application/vnd.sun.xml.calc.template", nil, Sheet, OpenSheet},371 // Data372 {"text/csv", []string{".csv"}, Data, Csv},373 {"application/json", []string{".json"}, Data, Json},374 {"application/xml", []string{".xml", ".xsd"}, Data, Xml},375 {"text/xml", nil, Data, Xml},376 {"text/x-protobuf", []string{".proto"}, Data, Protobuf},377 {"text/x-ini", []string{".ini", ".cfg", ".inf"}, Data, Ini},378 {"text/x-ini-file", nil, Data, Ini},379 {"text/uri-list", nil, Data, Uri},380 {"application/x-color", nil, Data, Color},381 {"application/rdf+xml", []string{".rdf"}, Data, NoSupport},382 {"application/msaccess", []string{".mdb"}, Data, NoSupport},383 {"application/vnd.oasis.opendocument.database", []string{".odb"}, Data, NoSupport},384 {"text/tab-separated-values", []string{".tsv"}, Data, Tsv},385 {"application/vnd.google-earth.kml+xml", []string{".kml", ".kmz"}, Data, NoSupport},386 {"application/vnd.google-earth.kmz", nil, Data, NoSupport},387 {"application/x-sql", []string{".sql"}, Data, NoSupport},388 {"application/vnd.gogi", nil, Data, GoGi}, // our own special unregistered type..389 // Text390 {"text/plain", []string{".asc", ".txt", ".text", ".pot", ".brf", ".srt"}, Text, PlainText},391 {"text/cache-manifest", []string{".appcache"}, Text, NoSupport},392 {"text/calendar", []string{".ics", ".icz"}, Text, ICal},393 {"text/x-vcalendar", []string{".vcs"}, Text, VCal},394 {"text/vcard", []string{".vcf", ".vcard"}, Text, VCard},395 // Image396 {"application/pdf", []string{".pdf"}, Image, Pdf},397 {"application/postscript", []string{".ps", ".ai", ".eps", ".epsi", ".epsf", ".eps2", ".eps3"}, Image, Postscript},398 {"application/vnd.oasis.opendocument.graphics", []string{".odc", ".odg", ".otg", ".odi", ".sxd", ".std"}, Image, NoSupport},399 {"application/vnd.oasis.opendocument.chart", nil, Image, NoSupport},400 {"application/vnd.oasis.opendocument.graphics-template", nil, Image, NoSupport},401 {"application/vnd.oasis.opendocument.image", nil, Image, NoSupport},402 {"application/vnd.sun.xml.draw", nil, Image, NoSupport},403 {"application/vnd.sun.xml.draw.template", nil, Image, NoSupport},404 {"application/x-xfig", []string{".fig"}, Image, NoSupport},405 {"application/x-xcf", []string{".xcf"}, Image, Gimp},406 {"text/vnd.graphviz", []string{".gv"}, Image, GraphVis},407 {"image/gif", []string{".gif"}, Image, Gif},408 {"image/ief", []string{".ief"}, Image, NoSupport},409 {"image/jp2", []string{".jp2", ".jpg2"}, Image, NoSupport},410 {"image/jpeg", []string{".jpeg", ".jpg", ".jpe"}, Image, Jpeg},411 {"image/jpm", []string{".jpm"}, Image, NoSupport},412 {"image/jpx", []string{".jpx", ".jpf"}, Image, NoSupport},413 {"image/pcx", []string{".pcx"}, Image, NoSupport},414 {"image/png", []string{".png"}, Image, Png},415 {"image/heic", []string{".heic"}, Image, Heic},416 {"image/heif", []string{".heif"}, Image, Heif},417 {"image/svg+xml", []string{".svg", ".svgz"}, Image, Svg},418 {"image/tiff", []string{".tiff", ".tif"}, Image, Tiff},419 {"image/vnd.djvu", []string{".djvu", ".djv"}, Image, NoSupport},420 {"image/vnd.microsoft.icon", []string{".ico"}, Image, NoSupport},421 {"image/vnd.wap.wbmp", []string{".wbmp"}, Image, NoSupport},422 {"image/x-canon-cr2", []string{".cr2"}, Image, NoSupport},423 {"image/x-canon-crw", []string{".crw"}, Image, NoSupport},424 {"image/x-cmu-raster", []string{".ras"}, Image, NoSupport},425 {"image/x-coreldraw", []string{".cdr", ".pat", ".cdt", ".cpt"}, Image, NoSupport},426 {"image/x-coreldrawpattern", nil, Image, NoSupport},427 {"image/x-coreldrawtemplate", nil, Image, NoSupport},428 {"image/x-corelphotopaint", nil, Image, NoSupport},429 {"image/x-epson-erf", []string{".erf"}, Image, NoSupport},430 {"image/x-jg", []string{".art"}, Image, NoSupport},431 {"image/x-jng", []string{".jng"}, Image, NoSupport},432 {"image/x-ms-bmp", []string{".bmp"}, Image, Bmp},433 {"image/x-nikon-nef", []string{".nef"}, Image, NoSupport},434 {"image/x-olympus-orf", []string{".orf"}, Image, NoSupport},435 {"image/x-photoshop", []string{".psd"}, Image, NoSupport},436 {"image/x-portable-anymap", []string{".pnm"}, Image, Pnm},437 {"image/x-portable-bitmap", []string{".pbm"}, Image, Pbm},438 {"image/x-portable-graymap", []string{".pgm"}, Image, Pgm},439 {"image/x-portable-pixmap", []string{".ppm"}, Image, Ppm},440 {"image/x-rgb", []string{".rgb"}, Image, NoSupport},441 {"image/x-xbitmap", []string{".xbm"}, Image, Xbm},442 {"image/x-xpixmap", []string{".xpm"}, Image, Xpm},443 {"image/x-xwindowdump", []string{".xwd"}, Image, NoSupport},444 // Model445 {"model/iges", []string{".igs", ".iges"}, Model, NoSupport},446 {"model/mesh", []string{".msh", ".mesh", ".silo"}, Model, NoSupport},447 {"model/vrml", []string{".wrl", ".vrml", ".vrm"}, Model, Vrml},448 {"x-world/x-vrml", nil, Model, Vrml},449 {"model/x3d+xml", []string{".x3dv", ".x3d", ".x3db"}, Model, X3d},450 {"model/x3d+vrml", nil, Model, X3d},451 {"model/x3d+binary", nil, Model, X3d},452 // Audio453 {"audio/aac", []string{".aac"}, Audio, Aac},454 {"audio/flac", []string{".flac"}, Audio, Flac},455 {"audio/mpeg", []string{".mpga", ".mpega", ".mp2", ".mp3", ".m4a"}, Audio, Mp3},456 {"audio/mpegurl", []string{".m3u"}, Audio, NoSupport},457 {"audio/x-mpegurl", nil, Audio, NoSupport},458 {"audio/ogg", []string{".oga", ".ogg", ".opus", ".spx"}, Audio, Ogg},459 {"audio/amr", []string{".amr"}, Audio, NoSupport},460 {"audio/amr-wb", []string{".awb"}, Audio, NoSupport},461 {"audio/annodex", []string{".axa"}, Audio, NoSupport},462 {"audio/basic", []string{".au", ".snd"}, Audio, NoSupport},463 {"audio/csound", []string{".csd", ".orc", ".sco"}, Audio, NoSupport},464 {"audio/midi", []string{".mid", ".midi", ".kar"}, Audio, Midi},465 {"audio/prs.sid", []string{".sid"}, Audio, NoSupport},466 {"audio/x-aiff", []string{".aif", ".aiff", ".aifc"}, Audio, NoSupport},467 {"audio/x-gsm", []string{".gsm"}, Audio, NoSupport},468 {"audio/x-ms-wma", []string{".wma"}, Audio, NoSupport},469 {"audio/x-ms-wax", []string{".wax"}, Audio, NoSupport},470 {"audio/x-pn-realaudio", []string{".ra", ".rm", ".ram"}, Audio, NoSupport},471 {"audio/x-realaudio", nil, Audio, NoSupport},472 {"audio/x-scpls", []string{".pls"}, Audio, NoSupport},473 {"audio/x-sd2", []string{".sd2"}, Audio, NoSupport},474 {"audio/x-wav", []string{".wav"}, Audio, Wav},475 // Video476 {"video/3gpp", []string{".3gp"}, Video, NoSupport},477 {"video/annodex", []string{".axv"}, Video, NoSupport},478 {"video/dl", []string{".dl"}, Video, NoSupport},479 {"video/dv", []string{".dif", ".dv"}, Video, NoSupport},480 {"video/fli", []string{".fli"}, Video, NoSupport},481 {"video/gl", []string{".gl"}, Video, NoSupport},482 {"video/h264", nil, Video, NoSupport},483 {"video/mpeg", []string{".mpeg", ".mpg", ".mpe"}, Video, Mpeg},484 {"video/MP2T", []string{".ts"}, Video, NoSupport},485 {"video/mp4", []string{".mp4"}, Video, Mp4},486 {"video/quicktime", []string{".qt", ".mov"}, Video, Mov},487 {"video/ogg", []string{".ogv"}, Video, Ogv},488 {"video/webm", []string{".webm"}, Video, NoSupport},489 {"video/vnd.mpegurl", []string{".mxu"}, Video, NoSupport},490 {"video/x-flv", []string{".flv"}, Video, NoSupport},491 {"video/x-la-asf", []string{".lsf", ".lsx"}, Video, NoSupport},492 {"video/x-mng", []string{".mng"}, Video, NoSupport},493 {"video/x-ms-asf", []string{".asf", ".asx"}, Video, NoSupport},494 {"video/x-ms-wm", []string{".wm"}, Video, NoSupport},495 {"video/x-ms-wmv", []string{".wmv"}, Video, Wmv},496 {"video/x-ms-wmx", []string{".wmx"}, Video, NoSupport},497 {"video/x-ms-wvx", []string{".wvx"}, Video, NoSupport},498 {"video/x-msvideo", []string{".avi"}, Video, Avi},499 {"video/x-sgi-movie", []string{".movie"}, Video, NoSupport},500 {"video/x-matroska", []string{".mpv", ".mkv"}, Video, NoSupport},501 {"application/x-shockwave-flash", []string{".swf"}, Video, NoSupport},502 // Font503 {"font/ttf", []string{".otf", ".ttf", ".ttc"}, Font, TrueType},504 {"font/otf", nil, Font, TrueType},505 {"application/font-sfnt", nil, Font, TrueType},506 {"application/x-font-ttf", nil, Font, TrueType},507 {"application/x-font", []string{".pfa", ".pfb", ".gsf", ".pcf", ".pcf.Z"}, Font, NoSupport},508 {"application/x-font-pcf", nil, Font, NoSupport},509 {"application/vnd.ms-fontobject", []string{".eot"}, Font, NoSupport},510 {"font/woff", []string{".woff", ".woff2"}, Font, WebOpenFont},511 {"font/woff2", nil, Font, WebOpenFont},512 {"application/font-woff", nil, Font, WebOpenFont},513 // Exe514 {"application/x-executable", nil, Exe, NoSupport},515 {"application/x-msdos-program", []string{".com", ".exe", ".bat", ".dll"}, Exe, NoSupport},516 // Binary517 {"application/octet-stream", []string{".bin"}, Bin, NoSupport},518 {"application/x-object", []string{".o"}, Bin, NoSupport},519 {"text/x-libtool", nil, Bin, NoSupport},520}521// below are entries from official /etc/mime.types that we don't recognize522// or consider to be old / obsolete / not relevant -- please file an issue523// or a pull-request to add to main list or add yourself in your own app524// application/activemessage525// application/andrew-insetez526// application/annodexanx527// application/applefile528// application/atom+xmlatom529// application/atomcat+xmlatomcat530// application/atomicmail531// application/atomserv+xmlatomsrv532// application/batch-SMTP533// application/bbolinlin534// application/beep+xml535// application/cals-1840536// application/commonground537// application/cu-seemecu538// application/cybercash539// application/davmount+xmldavmount540// application/dca-rft541// application/dec-dx542// application/dicomdcm543// application/docbook+xml544// application/dsptypetsp545// application/dvcs546// application/edi-consent547// application/edi-x12548// application/edifact549// application/eshop550// application/font-tdpfrpfr551// application/futuresplashspl552// application/ghostview553// application/htahta554// application/http555// application/hyperstudio556// application/iges557// application/index558// application/index.cmd559// application/index.obj560// application/index.response561// application/index.vnd562// application/iotp563// application/ipp564// application/isup565// application/java-serialized-objectser566// application/java-vmclass567// application/m3gm3g568// application/mac-binhex40hqx569// application/mac-compactprocpt570// application/macwriteii571// application/marc572// application/mxfmxf573// application/news-message-id574// application/news-transmission575// application/ocsp-request576// application/ocsp-response577// application/octet-streambin deploy msu msp578// application/odaoda579// application/oebps-package+xmlopf580// application/oggogx581// application/parityfec582// application/pics-rulesprf583// application/pkcs10584// application/pkcs7-mime585// application/pkcs7-signature586// application/pkix-cert587// application/pkix-crl588// application/pkixcmp589// application/prs.alvestrand.titrax-sheet590// application/prs.cww591// application/prs.nprend592// application/qsig593// application/remote-printing594// application/riscos595// application/sdp596// application/set-payment597// application/set-payment-initiation598// application/set-registration599// application/set-registration-initiation600// application/sgml601// application/sgml-open-catalog602// application/sieve603// application/slastl604// application/slate605// application/smil+xmlsmi smil606// application/timestamp-query607// application/timestamp-reply608// application/vemmi609// application/whoispp-query610// application/whoispp-response611// application/wita612// application/x400-bp613// application/xml-dtd614// application/xml-external-parsed-entity615// application/xslt+xmlxsl xslt616// application/xspf+xmlxspf617// application/vnd.3M.Post-it-Notes618// application/vnd.accpac.simply.aso619// application/vnd.accpac.simply.imp620// application/vnd.acucobol621// application/vnd.aether.imp622// application/vnd.anser-web-certificate-issue-initiation623// application/vnd.anser-web-funds-transfer-initiation624// application/vnd.audiograph625// application/vnd.bmi626// application/vnd.businessobjects627// application/vnd.canon-cpdl628// application/vnd.canon-lips629// application/vnd.cinderellacdy630// application/vnd.claymore631// application/vnd.commerce-battelle632// application/vnd.commonspace633// application/vnd.comsocaller634// application/vnd.contact.cmsg635// application/vnd.cosmocaller636// application/vnd.ctc-posml637// application/vnd.cups-postscript638// application/vnd.cups-raster639// application/vnd.cups-raw640// application/vnd.cybank641// application/vnd.dna642// application/vnd.dpgraph643// application/vnd.dxr644// application/vnd.ecdis-update645// application/vnd.ecowin.chart646// application/vnd.ecowin.filerequest647// application/vnd.ecowin.fileupdate648// application/vnd.ecowin.series649// application/vnd.ecowin.seriesrequest650// application/vnd.ecowin.seriesupdate651// application/vnd.enliven652// application/vnd.epson.esf653// application/vnd.epson.msf654// application/vnd.epson.quickanime655// application/vnd.epson.salt656// application/vnd.epson.ssf657// application/vnd.ericsson.quickcall658// application/vnd.eudora.data659// application/vnd.fdf660// application/vnd.ffsns661// application/vnd.flographit662// application/vnd.font-fontforge-sfdsfd663// application/vnd.framemaker664// application/vnd.fsc.weblaunch665// application/vnd.fujitsu.oasys666// application/vnd.fujitsu.oasys2667// application/vnd.fujitsu.oasys3668// application/vnd.fujitsu.oasysgp669// application/vnd.fujitsu.oasysprs670// application/vnd.fujixerox.ddd671// application/vnd.fujixerox.docuworks672// application/vnd.fujixerox.docuworks.binder673// application/vnd.fut-misnet674// application/vnd.grafeq675// application/vnd.groove-account676// application/vnd.groove-identity-message677// application/vnd.groove-injector678// application/vnd.groove-tool-message679// application/vnd.groove-tool-template680// application/vnd.groove-vcard681// application/vnd.hhe.lesson-player682// application/vnd.hp-HPGL683// application/vnd.hp-PCL684// application/vnd.hp-PCLXL685// application/vnd.hp-hpid686// application/vnd.hp-hps687// application/vnd.httphone688// application/vnd.hzn-3d-crossword689// application/vnd.ibm.MiniPay690// application/vnd.ibm.afplinedata691// application/vnd.ibm.modcap692// application/vnd.informix-visionary693// application/vnd.intercon.formnet694// application/vnd.intertrust.digibox695// application/vnd.intertrust.nncp696// application/vnd.intu.qbo697// application/vnd.intu.qfx698// application/vnd.irepository.package+xml699// application/vnd.is-xpr700// application/vnd.japannet-directory-service701// application/vnd.japannet-jpnstore-wakeup702// application/vnd.japannet-payment-wakeup703// application/vnd.japannet-registration704// application/vnd.japannet-registration-wakeup705// application/vnd.japannet-setstore-wakeup706// application/vnd.japannet-verification707// application/vnd.japannet-verification-wakeup708// application/vnd.koan709// application/vnd.lotus-1-2-3710// application/vnd.lotus-approach711// application/vnd.lotus-freelance712// application/vnd.lotus-notes713// application/vnd.lotus-organizer714// application/vnd.lotus-screencam715// application/vnd.lotus-wordpro716// application/vnd.mcd717// application/vnd.mediastation.cdkey718// application/vnd.meridian-slingshot719// application/vnd.mif720// application/vnd.minisoft-hp3000-save721// application/vnd.mitsubishi.misty-guard.trustweb722// application/vnd.mobius.daf723// application/vnd.mobius.dis724// application/vnd.mobius.msl725// application/vnd.mobius.plc726// application/vnd.mobius.txf727// application/vnd.motorola.flexsuite728// application/vnd.motorola.flexsuite.adsi729// application/vnd.motorola.flexsuite.fis730// application/vnd.motorola.flexsuite.gotap731// application/vnd.motorola.flexsuite.kmr732// application/vnd.motorola.flexsuite.ttc733// application/vnd.motorola.flexsuite.wem734// application/vnd.mozilla.xul+xmlxul735// application/vnd.ms-artgalry736// application/vnd.ms-asf737// application/vnd.ms-excel.addin.macroEnabled.12xlam738// application/vnd.ms-excel.sheet.binary.macroEnabled.12xlsb739// application/vnd.ms-excel.sheet.macroEnabled.12xlsm740// application/vnd.ms-excel.template.macroEnabled.12xltm741// application/vnd.ms-fontobjecteot742// application/vnd.ms-lrm743// application/vnd.ms-officethemethmx744// application/vnd.ms-pki.seccatcat745// #application/vnd.ms-pki.stlstl746// application/vnd.ms-powerpoint.addin.macroEnabled.12ppam747// application/vnd.ms-powerpoint.presentation.macroEnabled.12pptm748// application/vnd.ms-powerpoint.slide.macroEnabled.12sldm749// application/vnd.ms-powerpoint.slideshow.macroEnabled.12ppsm750// application/vnd.ms-powerpoint.template.macroEnabled.12potm751// application/vnd.ms-project752// application/vnd.ms-word.document.macroEnabled.12docm753// application/vnd.ms-word.template.macroEnabled.12dotm754// application/vnd.ms-works755// application/vnd.mseq756// application/vnd.msign757// application/vnd.music-niff758// application/vnd.musician759// application/vnd.netfpx760// application/vnd.noblenet-directory761// application/vnd.noblenet-sealer762// application/vnd.noblenet-web763// application/vnd.novadigm.EDM764// application/vnd.novadigm.EDX765// application/vnd.novadigm.EXT766// application/vnd.osa.netdeploy767// application/vnd.palm768// application/vnd.pg.format769// application/vnd.pg.osasli770// application/vnd.powerbuilder6771// application/vnd.powerbuilder6-s772// application/vnd.powerbuilder7773// application/vnd.powerbuilder7-s774// application/vnd.powerbuilder75775// application/vnd.powerbuilder75-s776// application/vnd.previewsystems.box777// application/vnd.publishare-delta-tree778// application/vnd.pvi.ptid1779// application/vnd.pwg-xhtml-print+xml780// application/vnd.rapid781// application/vnd.rim.codcod782// application/vnd.s3sms783// application/vnd.seemail784// application/vnd.shana.informed.formdata785// application/vnd.shana.informed.formtemplate786// application/vnd.shana.informed.interchange787// application/vnd.shana.informed.package788// application/vnd.smafmmf789// application/vnd.sss-cod790// application/vnd.sss-dtf791// application/vnd.sss-ntf792// application/vnd.stardivision.calcsdc793// application/vnd.stardivision.chartsds794// application/vnd.stardivision.drawsda795// application/vnd.stardivision.impresssdd796// application/vnd.stardivision.mathsdf797// application/vnd.stardivision.writersdw798// application/vnd.stardivision.writer-globalsgl799// application/vnd.street-stream800// application/vnd.svd801// application/vnd.swiftview-ics802// application/vnd.symbian.installsis803// application/vnd.tcpdump.pcapcap pcap804// application/vnd.triscape.mxs805// application/vnd.trueapp806// application/vnd.truedoc807// application/vnd.tve-trigger808// application/vnd.ufdl809// application/vnd.uplanet.alert810// application/vnd.uplanet.alert-wbxml811// application/vnd.uplanet.bearer-choice812// application/vnd.uplanet.bearer-choice-wbxml813// application/vnd.uplanet.cacheop814// application/vnd.uplanet.cacheop-wbxml815// application/vnd.uplanet.channel816// application/vnd.uplanet.channel-wbxml817// application/vnd.uplanet.list818// application/vnd.uplanet.list-wbxml819// application/vnd.uplanet.listcmd820// application/vnd.uplanet.listcmd-wbxml821// application/vnd.uplanet.signal822// application/vnd.vcx823// application/vnd.vectorworks824// application/vnd.vidsoft.vidconference825// application/vnd.visiovsd vst vsw vss826// application/vnd.vividence.scriptfile827// application/vnd.wap.sic828// application/vnd.wap.slc829// application/vnd.wap.wbxmlwbxml830// application/vnd.wap.wmlcwmlc831// application/vnd.wap.wmlscriptcwmlsc832// application/vnd.webturbo833// application/vnd.wordperfectwpd834// application/vnd.wordperfect5.1wp5835// application/vnd.wrq-hp3000-labelled836// application/vnd.wt.stf837// application/vnd.xara838// application/vnd.xfdl839// application/vnd.yellowriver-custom-menu840// application/zlib841// application/x-123wk842// application/x-abiwordabw843// application/x-bcpiobcpio844// application/x-cabcab845// application/x-cbrcbr846// application/x-cbzcbz847// application/x-cdfcdf cda848// application/x-cdlinkvcd849// application/x-chess-pgnpgn850// application/x-comsolmph851// application/x-core852// application/x-cpiocpio853// application/x-directordcr dir dxr854// application/x-dmsdms855// application/x-doomwad856// application/x-dvidvi857// application/x-freemindmm858// application/x-futuresplashspl859// application/x-ganttprojectgan860// application/x-gnumericgnumeric861// application/x-go-sgfsgf862// application/x-graphing-calculatorgcf863// application/x-hdfhdf864// #application/x-httpd-erubyrhtml865// #application/x-httpd-phpphtml pht php866// #application/x-httpd-php-sourcephps867// #application/x-httpd-php3php3868// #application/x-httpd-php3-preprocessedphp3p869// #application/x-httpd-php4php4870// #application/x-httpd-php5php5871// application/x-hwphwp872// application/x-icaica873// application/x-infoinfo874// application/x-internet-signupins isp875// application/x-iphoneiii876// application/x-iso9660-imageiso877// application/x-jamjam878// application/x-java-applet879// application/x-java-bean880// application/x-java-jnlp-filejnlp881// application/x-jmoljmz882// application/x-kchartchrt883// application/x-kdelnk884// application/x-killustratorkil885// application/x-koanskp skd skt skm886// application/x-kpresenterkpr kpt887// application/x-kspreadksp888// application/x-kwordkwd kwt889// application/x-lhalha890// application/x-lyxlyx891// application/x-lzhlzh892// application/x-lzxlzx893// application/x-makerfrm maker frame fm fb book fbdoc894// application/x-mifmif895// application/x-mpegURLm3u8896// application/x-ms-applicationapplication897// application/x-ms-manifestmanifest898// application/x-ms-wmdwmd899// application/x-ms-wmzwmz900// application/x-msimsi901// application/x-netcdfnc902// application/x-ns-proxy-autoconfigpac903// application/x-nwcnwc904// application/x-oz-applicationoza905// application/x-pkcs7-certreqrespp7r906// application/x-pkcs7-crlcrl907// application/x-qgisqgs shp shx908// application/x-quicktimeplayerqtl909// application/x-rdprdp910// application/x-rx911// application/x-scilabsci sce912// application/x-scilab-xcosxcos913// application/x-shellscript914// application/x-shockwave-flashswf swfl915// application/x-silverlightscr916// application/x-sv4cpiosv4cpio917// application/x-sv4crcsv4crc918// application/x-tex-gfgf919// application/x-tex-pkpk920// application/x-ustarustar921// application/x-videolan922// application/x-wais-sourcesrc923// application/x-wingzwz924// application/x-x509-ca-certcrt925// application/x-xpinstallxpi926// audio/32kadpcm927// audio/3gpp928// audio/g.722.1929// audio/l16930// audio/mp4a-latm931// audio/mpa-robust932// audio/parityfec933// audio/telephone-event934// audio/tone935// audio/vnd.cisco.nse936// audio/vnd.cns.anp1937// audio/vnd.cns.inf1938// audio/vnd.digital-winds939// audio/vnd.everad.plj940// audio/vnd.lucent.voice941// audio/vnd.nortel.vbk942// audio/vnd.nuera.ecelp4800943// audio/vnd.nuera.ecelp7470944// audio/vnd.nuera.ecelp9600945// audio/vnd.octel.sbc946// audio/vnd.qcelp947// audio/vnd.rhetorex.32kadpcm948// audio/vnd.vmx.cvsd949// chemical/x-alchemyalc950// chemical/x-cachecac cache951// chemical/x-cache-csfcsf952// chemical/x-cactvs-binarycbin cascii ctab953// chemical/x-cdxcdx954// chemical/x-ceriuscer955// chemical/x-chem3dc3d956// chemical/x-chemdrawchm957// chemical/x-cifcif958// chemical/x-cmdfcmdf959// chemical/x-cmlcml960// chemical/x-compasscpa961// chemical/x-crossfirebsd962// chemical/x-csmlcsml csm963// chemical/x-ctxctx964// chemical/x-cxfcxf cef965// #chemical/x-daylight-smilessmi966// chemical/x-embl-dl-nucleotideemb embl967// chemical/x-galactic-spcspc968// chemical/x-gamess-inputinp gam gamin969// chemical/x-gaussian-checkpointfch fchk970// chemical/x-gaussian-cubecub971// chemical/x-gaussian-inputgau gjc gjf972// chemical/x-gaussian-loggal973// chemical/x-gcg8-sequencegcg974// chemical/x-genbankgen975// chemical/x-hinhin976// chemical/x-isostaristr ist977// chemical/x-jcamp-dxjdx dx978// chemical/x-kinemagekin979// chemical/x-macmoleculemcm980// chemical/x-macromodel-inputmmd mmod981// chemical/x-mdl-molfilemol982// chemical/x-mdl-rdfilerd983// chemical/x-mdl-rxnfilerxn984// chemical/x-mdl-sdfilesd sdf985// chemical/x-mdl-tgftgf986// #chemical/x-mifmif987// chemical/x-mmcifmcif988// chemical/x-mol2mol2989// chemical/x-molconn-Zb990// chemical/x-mopac-graphgpt991// chemical/x-mopac-inputmop mopcrt mpc zmt992// chemical/x-mopac-outmoo993// chemical/x-mopac-vibmvb994// chemical/x-ncbi-asn1asn995// chemical/x-ncbi-asn1-asciiprt ent996// chemical/x-ncbi-asn1-binaryval aso997// chemical/x-ncbi-asn1-specasn998// chemical/x-pdbpdb ent999// chemical/x-rosdalros1000// chemical/x-swissprotsw1001// chemical/x-vamas-iso14976vms1002// chemical/x-vmdvmd1003// chemical/x-xtelxtel1004// chemical/x-xyzxyz1005// image/cgm1006// image/g3fax1007// image/naplps1008// image/prs.btif1009// image/prs.pti1010// image/vnd.cns.inf21011// image/vnd.dwg1012// image/vnd.dxf1013// image/vnd.fastbidsheet1014// image/vnd.fpx1015// image/vnd.fst1016// image/vnd.fujixerox.edmics-mmr1017// image/vnd.fujixerox.edmics-rlc1018// image/vnd.mix1019// image/vnd.net-fpx1020// image/vnd.svf1021// image/vnd.xiff1022// image/x-icon1023// inode/chardevice1024// inode/blockdevice1025// inode/directory-locked1026// inode/directory1027// inode/fifo1028// inode/socket1029// message/delivery-status1030// message/disposition-notification1031// message/external-body1032// message/http1033// message/s-http1034// message/news1035// message/partial1036// message/rfc822eml1037// model/vnd.dwf1038// model/vnd.flatland.3dml1039// model/vnd.gdl1040// model/vnd.gs-gdl1041// model/vnd.gtw1042// model/vnd.mts1043// model/vnd.vtu1044// multipart/alternative1045// multipart/appledouble1046// multipart/byteranges1047// multipart/digest1048// multipart/encrypted1049// multipart/form-data1050// multipart/header-set1051// multipart/mixed1052// multipart/parallel1053// multipart/related1054// multipart/report1055// multipart/signed1056// multipart/voice-message1057// text/english1058// text/enriched1059// {"text/x-gap",1060// {"text/x-gtkrc",1061// text/h3233231062// text/iulsuls1063//{"text/x-idl",1064//{"text/x-netrexx",1065//{"text/x-ocl",1066//{"text/x-dtd",1067// {"text/x-gettext-translation",1068// {"text/x-gettext-translation-template",1069// text/parityfec1070// text/prs.lines.tag1071// text/rfc822-headers1072// text/scriptletsct wsc1073// text/t1401074// text/texmacstm1075// text/turtlettl1076// text/vnd.abc1077// text/vnd.curl1078// text/vnd.debian.copyright1079// text/vnd.DMClientScript1080// text/vnd.flatland.3dml1081// text/vnd.fly1082// text/vnd.fmi.flexstor1083// text/vnd.in3d.3dml1084// text/vnd.in3d.spot1085// text/vnd.IPTC.NewsML1086// text/vnd.IPTC.NITF1087// text/vnd.latex-z1088// text/vnd.motorola.reflex1089// text/vnd.ms-mediapackage1090// text/vnd.sun.j2me.app-descriptorjad1091// text/vnd.wap.si1092// text/vnd.wap.sl1093// text/vnd.wap.wmlwml1094// text/vnd.wap.wmlscriptwmls1095// text/x-booboo1096// text/x-componenthtc1097// text/x-crontab1098// text/x-lilypondly1099// text/x-pcs-gcdgcd1100// text/x-setextetx1101// text/x-sfvsfv1102// video/mp4v-es1103// video/parityfec1104// video/pointer1105// video/vnd.fvt1106// video/vnd.motorola.video1107// video/vnd.motorola.videop1108// video/vnd.mts1109// video/vnd.nokia.interleaved-multimedia1110// video/vnd.vivo1111// x-conference/x-cooltalkice1112//1113// x-epoc/x-sisx-appsisx...
onepkg.go
Source:onepkg.go
1package onepkg2func Stuff() {}...
Stuff
Using AI Code Generation
1import "onepkg"2func main() {3 onepkg.Stuff()4}5import "twopkg"6func main() {7 twopkg.Stuff()8}9import "threepkg"10func main() {11 threepkg.Stuff()12}13import "fourpkg"14func main() {15 fourpkg.Stuff()16}17import "fivepkg"18func main() {19 fivepkg.Stuff()20}21import "sixpkg"22func main() {23 sixpkg.Stuff()24}25import "sevenpkg"26func main() {27 sevenpkg.Stuff()28}29import "eightpkg"30func main() {31 eightpkg.Stuff()32}33import "ninepkg"34func main() {35 ninepkg.Stuff()36}37import "tenpkg"38func main() {39 tenpkg.Stuff()40}41import "elevenpkg"42func main() {43 elevenpkg.Stuff()44}45import "twelvepkg"46func main() {47 twelvepkg.Stuff()48}49import "thirteenpkg"50func main() {51 thirteenpkg.Stuff()52}53import
Stuff
Using AI Code Generation
1import "fmt"2import "onepkg"3func main() {4 onepkg.Stuff()5}6import "fmt"7import "twopkg"8func main() {9 twopkg.Stuff()10}11import "fmt"12import "threepkg"13func main() {14 threepkg.Stuff()15}16import "fmt"17import "fourpkg"18func main() {19 fourpkg.Stuff()20}21import "fmt"22import "fivepkg"23func main() {24 fivepkg.Stuff()25}26import "fmt"27import "sixpkg"28func main() {29 sixpkg.Stuff()30}31import "fmt"32import "sevenpkg"33func main() {34 sevenpkg.Stuff()35}36import "fmt"37import "eightpkg"38func main() {39 eightpkg.Stuff()40}41import "fmt"42import "ninepkg"43func main() {44 ninepkg.Stuff()45}46import "fmt"47import "tenpkg"48func main() {49 tenpkg.Stuff()50}51import "fmt"52import "elevenpkg"53func main() {54 elevenpkg.Stuff()55}56import "fmt"57import "twelvepkg"58func main() {59 twelvepkg.Stuff()60}
Stuff
Using AI Code Generation
1import (2func main() {3 onepkg.Stuff()4}5import (6func main() {7 twopkg.Stuff()8}9And then you can import them in your source code:10import "github.com/username/repo/onepkg"11import "github.com/username/repo/twopkg"
Stuff
Using AI Code Generation
1import (2func main() {3 onepkg.Stuff()4 fmt.Println("Hello, world.")5}6import "fmt"7func Stuff() {8 fmt.Println("Stuff")9}10import (11func main() {12 onepkg.Stuff()13 fmt.Println("Hello, world.")14}15When I try to run this I get the following error: 1.go:5:2: cannot find package "onepkg" in any of: /usr/local/go/src/onepkg (from $GOROOT) /home/erik/go/src/onepkg (from $GOPATH)
Stuff
Using AI Code Generation
1import (2func main() {3 fmt.Println("Hello World")4 onepkg.Stuff()5}6import (7func main() {8 fmt.Println("Hello World")9 twopkg.Stuff()10}11 /usr/local/go/src/github.com/username/onepkg (from $GOROOT)12 /home/username/go/src/github.com/username/onepkg (from $GOPATH)
Stuff
Using AI Code Generation
1import "github.com/veerendra2/onepkg"2func main() {3 onepkg.Stuff()4}5import "github.com/veerendra2/twopkg"6func main() {7 twopkg.Stuff()8}9import "github.com/veerendra2/threepkg"10func main() {11 threepkg.Stuff()12}13import "github.com/veerendra2/fourpkg"14func main() {15 fourpkg.Stuff()16}17import "github.com/veerendra2/fivepkg"18func main() {19 fivepkg.Stuff()20}21import "github.com/veerendra2/sixpkg"22func main() {23 sixpkg.Stuff()24}25import "github.com/veerendra2/sevenpkg"26func main() {27 sevenpkg.Stuff()28}29import "github.com/veerendra2/eightpkg"30func main() {31 eightpkg.Stuff()32}33import "github.com/veerendra2/ninepkg"34func main() {35 ninepkg.Stuff()36}37import "github.com/veerendra2/tenpkg"38func main() {39 tenpkg.Stuff()40}41import "github.com/veerendra2/elevenpkg"42func main() {43 elevenpkg.Stuff()44}
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!