Search Options

Results per page
Sort
Preferred Languages
Advance

Results 141 - 150 of 560 for writefile (3.6 sec)

  1. operator/cmd/mesh/manifest_shared_test.go

    func readFile(path string) (string, error) {
    	b, err := os.ReadFile(path)
    	return string(b), err
    }
    
    // writeFile writes a file and returns an error if operation is unsuccessful.
    func writeFile(path string, data []byte) error {
    	return os.WriteFile(path, data, 0o644)
    }
    
    // inFileAbsolutePath returns the absolute path for an input file like "gateways".
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Feb 20 22:39:28 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  2. cmd/format-erasure_test.go

    	b, err := json.Marshal(m)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	if err = os.MkdirAll(pathJoin(rootPath, minioMetaBucket), os.FileMode(0o755)); err != nil {
    		t.Fatal(err)
    	}
    
    	if err = os.WriteFile(pathJoin(rootPath, minioMetaBucket, formatConfigFile), b, os.FileMode(0o644)); err != nil {
    		t.Fatal(err)
    	}
    
    	formatData, _, err := formatErasureMigrate(rootPath)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Apr 15 08:25:46 UTC 2024
    - 12.9K bytes
    - Viewed (0)
  3. security/tools/generate_cert/main.go

    		}
    	default:
    		log.Fatalf("Unsupported mode %v", *mode)
    	}
    }
    
    func saveCreds(certPem []byte, privPem []byte) {
    	err := os.WriteFile(*outCert, certPem, 0o644)
    	if err != nil {
    		log.Fatalf("Could not write output certificate: %s.", err)
    	}
    
    	err = os.WriteFile(*outPriv, privPem, 0o600)
    	if err != nil {
    		log.Fatalf("Could not write output private key: %s.", err)
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 28 16:21:30 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  4. src/cmd/link/internal/ld/elf_test.go

    	testenv.MustHaveGoBuild(t)
    	dir := t.TempDir()
    
    	const prog = `
    package main
    
    import "net"
    
    func main() {
    	net.Dial("", "")
    }
    `
    	src := filepath.Join(dir, "issue33358.go")
    	if err := os.WriteFile(src, []byte(prog), 0666); err != nil {
    		t.Fatal(err)
    	}
    
    	binFile := filepath.Join(dir, "issue33358")
    	cmd := testenv.Command(t, testenv.GoToolPath(t), "build", "-o", binFile, src)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 13:44:07 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  5. lib/time/mkzip.go

    		log.Fatal(err)
    	}
    	if len(seen) == 0 {
    		log.Fatalf("did not find any files to add")
    	}
    	if !seen["US/Eastern"] {
    		log.Fatalf("did not find US/Eastern to add")
    	}
    	if err := os.WriteFile(args[0], zb.Bytes(), 0666); err != nil {
    		log.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:32:07 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  6. src/crypto/tls/link_test.go

    	}
    	tmpDir := t.TempDir()
    	goFile := filepath.Join(tmpDir, "x.go")
    	exeFile := filepath.Join(tmpDir, "x.exe")
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			if err := os.WriteFile(goFile, []byte(tt.program), 0644); err != nil {
    				t.Fatal(err)
    			}
    			os.Remove(exeFile)
    			cmd := exec.Command(goBin, "build", "-o", "x.exe", "x.go")
    			cmd.Dir = tmpDir
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 09 11:28:56 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  7. pkg/test/cert/ca/root.go

    		ConfFile: filepath.Join(workDir, "root-ca.conf"),
    		CSRFile:  filepath.Join(workDir, "root-ca.csr"),
    		CertFile: filepath.Join(workDir, "root-cert.pem"),
    	}
    
    	// Write out the conf file.
    	if err := os.WriteFile(root.ConfFile, []byte(rootCAConf), os.ModePerm); err != nil {
    		return Root{}, err
    	}
    
    	// Create the root key.
    	if err := cert.GenerateKey(root.KeyFile); err != nil {
    		return Root{}, err
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 03 18:09:59 UTC 2021
    - 2.3K bytes
    - Viewed (0)
  8. cmd/kubemark/app/hollow_node_test.go

    		w.WriteHeader(200)
    		w.Write([]byte(`ok`))
    	}))
    	defer server.Close()
    
    	kubeconfigPath := filepath.Join(tmpDir, "config.kubeconfig")
    	if err := os.WriteFile(kubeconfigPath, []byte(fmt.Sprintf(fakeKubeconfig, server.URL)), os.FileMode(0600)); err != nil {
    		t.Fatal(err)
    	}
    
    	for morph := range knownMorphs {
    		morph := morph
    		t.Run(morph, func(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 10:06:15 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  9. test/linkmain_run.go

        importcfg, err := exec.Command("go", "list", "-export", "-f", "{{if .Export}}packagefile {{.ImportPath}}={{.Export}}{{end}}", "std").Output()
        if err != nil {
            fmt.Println(err)
            os.Exit(1)
        }
        os.WriteFile(tmp("importcfg"), importcfg, 0644)
    
    	// helloworld.go is package main
        run("go tool compile -p=main -importcfg", tmp("importcfg"), "-o", tmp("linkmain.o"), "helloworld.go")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  10. src/cmd/go/internal/envcmd/env_test.go

    		if runtime.GOOS == "windows" {
    			scriptfilename = "script.bat"
    		}
    		var cmd *exec.Cmd
    		if runtime.GOOS == "windows" {
    			scriptfile := filepath.Join(t.TempDir(), scriptfilename)
    			if err := os.WriteFile(scriptfile, b.Bytes(), 0777); err != nil {
    				t.Fatal(err)
    			}
    			cmd = testenv.Command(t, "cmd.exe", "/C", scriptfile)
    		} else {
    			cmd = testenv.Command(t, "sh", "-c", b.String())
    		}
    		out, err := cmd.Output()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 2.3K bytes
    - Viewed (0)
Back to top