Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for loadMimeFile (0.11 sec)

  1. src/mime/type_plan9.go

    	for _, filename := range typeFiles {
    		loadMimeFile(filename)
    	}
    }
    
    var typeFiles = []string{
    	"/sys/lib/mimetype",
    }
    
    func initMimeForTests() map[string]string {
    	typeFiles = []string{"testdata/test.types.plan9"}
    	return map[string]string{
    		".t1":  "application/test",
    		".t2":  "text/test; charset=utf-8",
    		".pNg": "image/png",
    	}
    }
    
    func loadMimeFile(filename string) {
    	f, err := os.Open(filename)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 15 19:56:08 UTC 2016
    - 1K bytes
    - Viewed (0)
  2. src/mime/type_unix.go

    			// the first entry that we see.
    			continue
    		}
    
    		setExtensionType(extension, fields[1])
    	}
    	if err := scanner.Err(); err != nil {
    		panic(err)
    	}
    	return nil
    }
    
    func loadMimeFile(filename string) {
    	f, err := os.Open(filename)
    	if err != nil {
    		return
    	}
    	defer f.Close()
    
    	scanner := bufio.NewScanner(f)
    	for scanner.Scan() {
    		fields := strings.Fields(scanner.Text())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 3K bytes
    - Viewed (0)
  3. src/mime/type_unix_test.go

    package mime
    
    import (
    	"testing"
    )
    
    func initMimeUnixTest(t *testing.T) {
    	once.Do(initMime)
    	err := loadMimeGlobsFile("testdata/test.types.globs2")
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	loadMimeFile("testdata/test.types")
    }
    
    func TestTypeByExtensionUNIX(t *testing.T) {
    	initMimeUnixTest(t)
    	typeTests := map[string]string{
    		".T1":       "application/test",
    		".t2":       "text/test; charset=utf-8",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 08 21:09:03 UTC 2022
    - 945 bytes
    - Viewed (0)
Back to top