Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 21 for DirFS (0.05 sec)

  1. src/net/http/filetransport.go

    // incoming requests, as well as most other properties of the
    // request.
    //
    // The typical use case for NewFileTransportFS is to register the "file"
    // protocol with a [Transport], as in:
    //
    //	fsys := os.DirFS("/")
    //	t := &http.Transport{}
    //	t.RegisterProtocol("file", http.NewFileTransportFS(fsys))
    //	c := &http.Client{Transport: t}
    //	res, err := c.Get("file:///etc/passwd")
    //	...
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  2. src/net/http/http_test.go

    func TestNoUnicodeStrings(t *testing.T) {
    	if !testenv.HasSrc() {
    		t.Skip("source code not available")
    	}
    
    	re := regexp.MustCompile(`(strings|bytes).([A-Za-z]+)`)
    	if err := fs.WalkDir(os.DirFS("."), ".", func(path string, d fs.DirEntry, err error) error {
    		if err != nil {
    			t.Fatal(err)
    		}
    
    		if path == "internal/ascii" {
    			return fs.SkipDir
    		}
    		if !strings.HasSuffix(path, ".go") ||
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 18:18:19 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  3. src/cmd/distpack/archive.go

    // The archive can be amended afterward using methods like Add and Filter.
    func NewArchive(dir string) (*Archive, error) {
    	a := new(Archive)
    	err := fs.WalkDir(os.DirFS(dir), ".", func(name string, d fs.DirEntry, err error) error {
    		if err != nil {
    			return err
    		}
    		if d.IsDir() {
    			return nil
    		}
    		info, err := d.Info()
    		if err != nil {
    			return err
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 11 17:37:52 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  4. cni/pkg/nodeagent/server.go

    		return nil, fmt.Errorf("error initializing the host rules for health checks: %w", err)
    	}
    
    	podNetns := NewPodNetnsProcFinder(os.DirFS(filepath.Join(pconstants.HostMountsPath, "proc")))
    	netServer := newNetServer(ztunnelServer, podNsMap, iptablesConfigurator, podNetns, set)
    
    	// Set some defaults
    	s := &Server{
    		ctx:        ctx,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 31 21:45:18 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  5. src/html/template/multi_test.go

    	_, err = template.ParseGlob("testdata/file*.tmpl")
    	if err != nil {
    		t.Fatalf("error parsing files: %v", err)
    	}
    	testExecute(multiExecTests, template, t)
    }
    
    func TestParseFS(t *testing.T) {
    	fs := os.DirFS("testdata")
    
    	{
    		_, err := ParseFS(fs, "DOES NOT EXIST")
    		if err == nil {
    			t.Error("expected error for non-existent file; got none")
    		}
    	}
    
    	{
    		template := New("root")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:48:16 UTC 2022
    - 8K bytes
    - Viewed (0)
  6. src/text/template/multi_test.go

    	_, err = template.ParseGlob("testdata/file*.tmpl")
    	if err != nil {
    		t.Fatalf("error parsing files: %v", err)
    	}
    	testExecute(multiExecTests, template, t)
    }
    
    func TestParseFS(t *testing.T) {
    	fs := os.DirFS("testdata")
    
    	{
    		_, err := ParseFS(fs, "DOES NOT EXIST")
    		if err == nil {
    			t.Error("expected error for non-existent file; got none")
    		}
    	}
    
    	{
    		template := New("root")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 08 10:48:29 UTC 2022
    - 11.7K bytes
    - Viewed (0)
  7. src/net/http/fs_test.go

    	for i := 0; i < 2; i++ {
    		var h Handler
    		var name string
    		switch i {
    		case 0:
    			h = FileServer(Dir("."))
    			name = "Dir"
    		case 1:
    			h = FileServer(FS(os.DirFS(".")))
    			name = "DirFS"
    		}
    		t.Run(name, func(t *testing.T) {
    			const want = "index.html says hello\n"
    			ts := newClientServerTest(t, mode, h).ts
    
    			for _, path := range []string{"/testdata/", "/testdata/index.html"} {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 49.9K bytes
    - Viewed (0)
  8. src/os/removeall_test.go

    	}
    }
    
    func BenchmarkRemoveAll(b *testing.B) {
    	tmpDir := filepath.Join(b.TempDir(), "target")
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		b.StopTimer()
    		err := CopyFS(tmpDir, DirFS("."))
    		if err != nil {
    			b.Fatal(err)
    		}
    		b.StartTimer()
    		if err := RemoveAll(tmpDir); err != nil {
    			b.Fatal(err)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:29 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"Chmod", Func, 0},
    		{"Chown", Func, 0},
    		{"Chtimes", Func, 0},
    		{"Clearenv", Func, 0},
    		{"Create", Func, 0},
    		{"CreateTemp", Func, 16},
    		{"DevNull", Const, 0},
    		{"DirEntry", Type, 16},
    		{"DirFS", Func, 16},
    		{"Environ", Func, 0},
    		{"ErrClosed", Var, 8},
    		{"ErrDeadlineExceeded", Var, 15},
    		{"ErrExist", Var, 0},
    		{"ErrInvalid", Var, 0},
    		{"ErrNoDeadline", Var, 10},
    		{"ErrNotExist", Var, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  10. api/go1.16.txt

    pkg os, const ModeTemporary fs.FileMode
    pkg os, const ModeType fs.FileMode
    pkg os, func Chmod(string, fs.FileMode) error
    pkg os, func CreateTemp(string, string) (*File, error)
    pkg os, func DirFS(string) fs.FS
    pkg os, func Lstat(string) (fs.FileInfo, error)
    pkg os, func Mkdir(string, fs.FileMode) error
    pkg os, func MkdirAll(string, fs.FileMode) error
    pkg os, func MkdirTemp(string, string) (string, error)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 02 16:30:41 UTC 2022
    - 479.2K bytes
    - Viewed (0)
Back to top