Copyright 2010 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
+build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris

package mime

import (
	
	
	
)

func () {
	osInitMime = initMimeUnix
}

var typeFiles = []string{
	"/etc/mime.types",
	"/etc/apache2/mime.types",
	"/etc/apache/mime.types",
	"/etc/httpd/conf/mime.types",
}

func ( string) {
	,  := os.Open()
	if  != nil {
		return
	}
	defer .Close()

	 := bufio.NewScanner()
	for .Scan() {
		 := strings.Fields(.Text())
		if len() <= 1 || [0][0] == '#' {
			continue
		}
		 := [0]
		for ,  := range [1:] {
			if [0] == '#' {
				break
			}
			setExtensionType("."+, )
		}
	}
	if  := .Err();  != nil {
		panic()
	}
}

func () {
	for ,  := range typeFiles {
		loadMimeFile()
	}
}

func () map[string]string {
	typeFiles = []string{"testdata/test.types"}
	return map[string]string{
		".T1":  "application/test",
		".t2":  "text/test; charset=utf-8",
		".png": "image/png",
	}