- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for tempfile (0.5 sec)
-
internal/config/certs_test.go
func createTempFile(prefix, content string) (tempFile string, err error) { var tmpfile *os.File if tmpfile, err = os.CreateTemp("", prefix); err != nil { return tempFile, err } if _, err = tmpfile.Write([]byte(content)); err != nil { return tempFile, err } if err = tmpfile.Close(); err != nil { return tempFile, err } tempFile = tmpfile.Name() return tempFile, err }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Mon Sep 19 18:05:16 GMT 2022 - 21.6K bytes - Viewed (0) -
cmd/xl-storage-errors.go
return errors.Is(err, syscall.EXDEV) } // Check if given error corresponds to too many open files func isSysErrTooManyFiles(err error) bool { return errors.Is(err, syscall.ENFILE) || errors.Is(err, syscall.EMFILE) } func osIsNotExist(err error) bool { return errors.Is(err, os.ErrNotExist) } func osIsPermission(err error) bool { return errors.Is(err, os.ErrPermission) || errors.Is(err, syscall.EROFS) }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Mon Mar 06 16:56:29 GMT 2023 - 3.8K bytes - Viewed (0) -
cmd/test-utils_test.go
// Fetch TLS key and pem files from test-data/ directory. // dir, _ := os.Getwd() // testDataDir := filepath.Join(filepath.Dir(dir), "test-data") // // pemFile := filepath.Join(testDataDir, "server.pem") // keyFile := filepath.Join(testDataDir, "server.key") cer, err := tls.X509KeyPair(cert, key) if err != nil { t.Fatalf("Failed to load certificate: %v", err) }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Fri May 03 17:26:51 GMT 2024 - 76.2K bytes - Viewed (0) -
cmd/common-main_test.go
}, } for _, testCase := range testCases { testCase := testCase t.Run("", func(t *testing.T) { tmpfile, err := os.CreateTemp("", "testfile") if err != nil { t.Error(err) } tmpfile.WriteString(testCase.content) tmpfile.Sync() tmpfile.Close() value, err := readFromSecret(tmpfile.Name()) if err != nil && !testCase.expectedErr { t.Error(err) }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Mon Sep 19 18:05:16 GMT 2022 - 3.7K bytes - Viewed (0) -
cmd/bitrot_test.go
package cmd import ( "context" "io" "testing" ) func testBitrotReaderWriterAlgo(t *testing.T, bitrotAlgo BitrotAlgorithm) { tmpDir := t.TempDir() volume := "testvol" filePath := "testfile" disk, err := newLocalXLStorage(tmpDir) if err != nil { t.Fatal(err) } disk.MakeVol(context.Background(), volume) writer := newBitrotWriter(disk, "", volume, filePath, 35, bitrotAlgo, 10)
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Tue Jan 30 20:43:25 GMT 2024 - 2.1K bytes - Viewed (0) -
internal/disk/stat_test.go
} for _, testCase := range testCases { testCase := testCase t.Run("", func(t *testing.T) { tmpfile, err := os.CreateTemp("", "testfile") if err != nil { t.Error(err) } tmpfile.WriteString(testCase.stat) tmpfile.Sync() tmpfile.Close() iostats, err := readDriveStats(tmpfile.Name()) if err != nil && !testCase.expectErr { t.Fatalf("unexpected err; %v", err) }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Mon Feb 26 19:34:50 GMT 2024 - 3.6K bytes - Viewed (0) -
cmd/update_test.go
func TestGetHelmVersion(t *testing.T) { createTempFile := func(content string) string { tmpfile, err := os.CreateTemp("", "helm-testfile-") if err != nil { t.Fatalf("Unable to create temporary file. %s", err) } if _, err = tmpfile.WriteString(content); err != nil { t.Fatalf("Unable to create temporary file. %s", err) } if err = tmpfile.Close(); err != nil { t.Fatalf("Unable to create temporary file. %s", err) }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Sat Mar 09 03:07:08 GMT 2024 - 10.7K bytes - Viewed (0) -
src/archive/tar/tar_test.go
"time" ) type testError struct{ error } type fileOps []any // []T where T is (string | int64) // testFile is an io.ReadWriteSeeker where the IO operations performed // on it must match the list of operations in ops. type testFile struct { ops fileOps pos int64 } func (f *testFile) Read(b []byte) (int, error) { if len(b) == 0 { return 0, nil } if len(f.ops) == 0 { return 0, io.EOF }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Mar 15 16:01:50 GMT 2024 - 24K bytes - Viewed (0) -
src/archive/tar/writer_test.go
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Feb 27 16:39:23 GMT 2024 - 38.7K bytes - Viewed (0) -
src/archive/tar/reader_test.go
} func TestFileReader(t *testing.T) { type ( testRead struct { // Read(cnt) == (wantStr, wantErr) cnt int wantStr string wantErr error } testWriteTo struct { // WriteTo(testFile{ops}) == (wantCnt, wantErr) ops fileOps wantCnt int64 wantErr error } testRemaining struct { // logicalRemaining() == wantLCnt, physicalRemaining() == wantPCnt wantLCnt int64
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Nov 21 21:14:38 GMT 2022 - 47.1K bytes - Viewed (0)