Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for tempfile (0.18 sec)

  1. 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)
  2. 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)
  3. 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)
  4. src/archive/tar/writer_test.go

    			hdr     Header
    			wantErr error
    		}
    		testWrite struct { // Write(str) == (wantCnt, wantErr)
    			str     string
    			wantCnt int
    			wantErr error
    		}
    		testReadFrom struct { // ReadFrom(testFile{ops}) == (wantCnt, wantErr)
    			ops     fileOps
    			wantCnt int64
    			wantErr error
    		}
    		testClose struct { // Close() == wantErr
    			wantErr error
    		}
    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)
  5. 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)
Back to top