Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for ReadFile (0.33 sec)

  1. istioctl/pkg/writer/envoy/configdump/configdump_test.go

    			inputFile:   "",
    			wantConfigs: 0,
    			wantErr:     true,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			cw := &ConfigWriter{}
    			cd, _ := os.ReadFile(tt.inputFile)
    			err := cw.Prime(cd)
    			if cw.configDump == nil {
    				if tt.wantConfigs != 0 {
    					t.Errorf("wanted some configs loaded but config dump was nil")
    				}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Wed Jan 03 23:08:06 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. internal/ioutil/read_file.go

    	_, err = io.ReadFull(f, dst)
    	return dst, st, err
    }
    
    // ReadFile reads the named file and returns the contents.
    // A successful call returns err == nil, not err == EOF.
    // Because ReadFile reads the whole file, it does not treat an EOF from Read
    // as an error to be reported.
    //
    // passes NOATIME flag for reads on Unix systems to avoid atime updates.
    func ReadFile(name string) ([]byte, error) {
    	// Don't wrap with un-needed buffer.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 09 18:17:51 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  3. istioctl/pkg/writer/compare/comparator_test.go

    func TestComparatorMismatchedConfigs(t *testing.T) {
    	cfg, err := os.ReadFile("testdata/configdump.json")
    	if err != nil {
    		t.Fatalf("Failed to read test data: %v", err)
    	}
    	diffCfg, err := os.ReadFile("testdata/configdump_diff.json")
    	if err != nil {
    		t.Fatalf("Failed to read test data: %v", err)
    	}
    
    	var outputBuffer bytes.Buffer
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Mar 12 10:02:09 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  4. operator/cmd/mesh/manifest_shared_test.go

    		for _, o := range objects.Items {
    			no := o.DeepCopy()
    			out = append(out, object.NewK8sObject(no, nil, nil))
    		}
    	}
    	return out
    }
    
    // readFile reads a file and returns the contents.
    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 {
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Feb 20 22:39:28 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  5. istioctl/pkg/writer/ztunnel/configdump/configdump_test.go

    			inputFile:   "testdata/dump.json",
    			wantConfigs: 27,
    			wantErr:     false,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			cw := &ConfigWriter{}
    			cd, _ := os.ReadFile(tt.inputFile)
    			err := cw.Prime(cd)
    			if cw.ztunnelDump == nil {
    				if tt.wantConfigs != 0 {
    					t.Errorf("wanted some configs loaded but config dump was nil")
    				}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Feb 02 18:21:48 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  6. cmd/bitrot-whole.go

    	tillOffset int64           // Affects the length of data requested in disk.ReadFile depending on Read()'s offset
    	buf        []byte          // Holds bit-rot verified data
    }
    
    func (b *wholeBitrotReader) ReadAt(buf []byte, offset int64) (n int, err error) {
    	if b.buf == nil {
    		b.buf = make([]byte, b.tillOffset-offset)
    		if _, err := b.disk.ReadFile(context.TODO(), b.volume, b.filePath, offset, b.buf, b.verifier); err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  7. operator/cmd/mesh/manifest-diff.go

    func compareManifestsFromFiles(args []string, verbose bool,
    	renameResources, selectResources, ignoreResources string,
    ) (bool, error) {
    	a, err := os.ReadFile(args[0])
    	if err != nil {
    		return false, fmt.Errorf("could not read %q: %v", args[0], err)
    	}
    	b, err := os.ReadFile(args[1])
    	if err != nil {
    		return false, fmt.Errorf("could not read %q: %v", args[1], err)
    	}
    
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Fri Mar 15 01:18:49 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  8. docs_src/generate_clients/tutorial004.js

    import * as fs from 'fs'
    
    async function modifyOpenAPIFile(filePath) {
      try {
        const data = await fs.promises.readFile(filePath)
        const openapiContent = JSON.parse(data)
    
        const paths = openapiContent.paths
        for (const pathKey of Object.keys(paths)) {
          const pathData = paths[pathKey]
          for (const method of Object.keys(pathData)) {
            const operation = pathData[method]
            if (operation.tags && operation.tags.length > 0) {
    JavaScript
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 14 11:40:05 GMT 2024
    - 1K bytes
    - Viewed (0)
  9. lib/time/mkzip.go

    	var zb bytes.Buffer
    	zw := zip.NewWriter(&zb)
    	seen := make(map[string]bool)
    	err := filepath.WalkDir(".", func(path string, d fs.DirEntry, err error) error {
    		if d.IsDir() {
    			return nil
    		}
    		data, err := os.ReadFile(path)
    		if err != nil {
    			log.Fatal(err)
    		}
    		if strings.HasSuffix(path, ".zip") {
    			log.Fatalf("unexpected file during walk: %s", path)
    		}
    		name := filepath.ToSlash(path)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 17:32:07 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  10. cni/test/install_cni.go

    // checkResult checks if resultFile is equal to expectedFile at each tick until timeout
    func checkResult(result, expected string) error {
    	resultFile, err := os.ReadFile(result)
    	if err != nil {
    		return fmt.Errorf("couldn't read result: %v", err)
    	}
    	expectedFile, err := os.ReadFile(expected)
    	if err != nil {
    		return fmt.Errorf("couldn't read expected: %v", err)
    	}
    	if !bytes.Equal(resultFile, expectedFile) {
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 12.5K bytes
    - Viewed (0)
Back to top