Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 554 for readFile (0.18 sec)

  1. istioctl/pkg/writer/pilot/status_test.go

    			for key, ss := range tt.input {
    				input[key] = ss
    			}
    
    			err := sw.PrintAll(input)
    			if tt.wantErr {
    				assert.Error(t, err)
    			} else {
    				assert.NoError(t, err)
    			}
    			want, _ := os.ReadFile(tt.want)
    			if err := util.Compare(got.Bytes(), want); err != nil {
    				t.Errorf(err.Error())
    			}
    		})
    	}
    }
    
    const clientConfigType = "type.googleapis.com/envoy.service.status.v3.ClientConfig"
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Mar 08 08:38:19 GMT 2024
    - 6.5K bytes
    - Viewed (0)
  2. cmd/xl-storage_test.go

    		}
    	}
    
    	{
    		buf := make([]byte, 5)
    		// Test for negative offset.
    		if _, err = xlStorage.ReadFile(context.Background(), volume, "myobject", -1, buf, v); err == nil {
    			t.Fatalf("expected: error, got: <nil>")
    		}
    	}
    
    	for l := 0; l < 2; l++ {
    		// Following block validates all ReadFile test cases.
    		for i, testCase := range testCases {
    			var n int64
    			// Common read buffer.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 17:45:28 GMT 2024
    - 66.7K bytes
    - Viewed (0)
  3. cmd/xl-storage.go

    // tries to verify whether the disk has bitrot.
    //
    // Additionally ReadFile also starts reading from an offset. ReadFile
    // semantics are same as io.ReadFull.
    func (s *xlStorage) ReadFile(ctx context.Context, volume string, path string, offset int64, buffer []byte, verifier *BitrotVerifier) (int64, error) {
    	if offset < 0 {
    		return 0, errInvalidArgument
    	}
    
    	volumeDir, err := s.getVolDir(volume)
    	if err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 84.7K bytes
    - Viewed (0)
  4. cmd/sftp-server.go

    	}
    
    	if sshPrivateKey == "" {
    		logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is mandatory for --sftp='ssh-private-key=path/to/id_ecdsa'"), "unable to start SFTP server")
    	}
    
    	privateBytes, err := os.ReadFile(sshPrivateKey)
    	if err != nil {
    		logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is not accessible: %v", err), "unable to start SFTP server")
    	}
    
    	private, err := ssh.ParsePrivateKey(privateBytes)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  5. docs/debugging/hash-set/main.go

    	}
    
    	if setCount == 0 {
    		log.Fatalln("set count cannot be zero")
    	}
    
    	id := uuid.MustParse(deploymentID)
    
    	if file != "" {
    		distrib := make([][]string, setCount)
    		b, err := os.ReadFile(file)
    		if err != nil {
    			log.Fatalln(err)
    		}
    		b = bytes.ReplaceAll(b, []byte("\r"), []byte{})
    		sc := bufio.NewScanner(bytes.NewBuffer(b))
    		for sc.Scan() {
    			object = strings.TrimSpace(sc.Text())
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  6. src/cmd/asm/internal/asm/endtoend_test.go

    	if !ok || failed {
    		t.Errorf("asm: %s assembly failed", goarch)
    		return
    	}
    	output := strings.Split(testOut.String(), "\n")
    
    	// Reconstruct expected output by independently "parsing" the input.
    	data, err := os.ReadFile(input)
    	if err != nil {
    		t.Error(err)
    		return
    	}
    	lineno := 0
    	seq := 0
    	hexByLine := map[string]string{}
    	lines := strings.SplitAfter(string(data), "\n")
    Diff:
    	for _, line := range lines {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Dec 07 18:42:59 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  7. cmd/common-main.go

    				// if so, decrypt it using the user-provided password.
    				certBytes, err := os.ReadFile(certFile)
    				if err != nil {
    					return tls.Certificate{}, fmt.Errorf("Unable to load KES client certificate as specified by the shell environment: %v", err)
    				}
    				keyBytes, err := os.ReadFile(keyFile)
    				if err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Apr 24 04:08:47 GMT 2024
    - 35.5K bytes
    - Viewed (2)
  8. internal/ioutil/ioutil_test.go

    		t.Fatal(err)
    	}
    	name2 := f.Name()
    	defer os.Remove(name2)
    	f.WriteString("bbbbbbbbbb")
    	f.Close()
    
    	if err = AppendFile(name1, name2, false); err != nil {
    		t.Error(err)
    	}
    
    	b, err := os.ReadFile(name1)
    	if err != nil {
    		t.Error(err)
    	}
    
    	expected := "aaaaaaaaaabbbbbbbbbb"
    	if string(b) != expected {
    		t.Errorf("AppendFile() failed, expected: %s, got %s", expected, string(b))
    	}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 11:02:31 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  9. docs/debugging/inspect/main.go

    )
    
    func main() {
    	flag.Parse()
    
    	if *genkey {
    		generateKeys()
    		os.Exit(0)
    	}
    	var privateKey []byte
    	if *keyHex == "" {
    		if b, err := os.ReadFile(*privKeyPath); err == nil {
    			privateKey = b
    			fmt.Println("Using private key from", *privKeyPath)
    		}
    
    		// Prompt for decryption key if no --key or --private-key are provided
    		if len(privateKey) == 0 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 21:22:47 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  10. istioctl/pkg/proxyconfig/proxyconfig.go

    	debug, err := extractConfigDump(kubeClient, podName, podNamespace, includeEds)
    	if err != nil {
    		return nil, err
    	}
    	return setupConfigdumpEnvoyConfigWriter(debug, out)
    }
    
    func readFile(filename string) ([]byte, error) {
    	file := os.Stdin
    	if filename != "-" {
    		var err error
    		file, err = os.Open(filename)
    		if err != nil {
    			return nil, err
    		}
    	}
    	defer func() {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Apr 16 03:28:36 GMT 2024
    - 48K bytes
    - Viewed (0)
Back to top