Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for Sscanln (0.23 sec)

  1. src/fmt/scan_test.go

    		t.Errorf("Sscanf: expected %q; got %q", input, tscanf)
    	}
    	// Sscanln should not work
    	var tscanln TwoLines
    	n, err = Sscanln(input, &tscanln)
    	if n != 0 {
    		t.Errorf("Sscanln: expected 0 items; got %d: %q", n, tscanln)
    	}
    	if err == nil {
    		t.Error("Sscanln: expected error; got none")
    	} else if err != io.ErrUnexpectedEOF {
    		t.Errorf("Sscanln: expected io.ErrUnexpectedEOF (ha!); got %s", err)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 20:25:13 UTC 2023
    - 39.3K bytes
    - Viewed (0)
  2. src/fmt/doc.go

    An analogous set of functions scans formatted text to yield
    values.  [Scan], [Scanf] and [Scanln] read from [os.Stdin]; [Fscan],
    [Fscanf] and [Fscanln] read from a specified [io.Reader]; [Sscan],
    [Sscanf] and [Sscanln] read from an argument string.
    
    [Scan], [Fscan], [Sscan] treat newlines in the input as spaces.
    
    [Scanln], [Fscanln] and [Sscanln] stop scanning at a newline and
    require that the items be followed by a newline or EOF.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:56:20 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  3. src/fmt/scan.go

    func Sscan(str string, a ...any) (n int, err error) {
    	return Fscan((*stringReader)(&str), a...)
    }
    
    // Sscanln is similar to [Sscan], but stops scanning at a newline and
    // after the final item there must be a newline or EOF.
    func Sscanln(str string, a ...any) (n int, err error) {
    	return Fscanln((*stringReader)(&str), a...)
    }
    
    // Sscanf scans the argument string, storing successive space-separated
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:56:20 UTC 2024
    - 31.9K bytes
    - Viewed (0)
  4. istioctl/pkg/util/common.go

    }
    
    // Confirm waits for a user to confirm with the supplied message.
    func Confirm(msg string, writer io.Writer) bool {
    	for {
    		_, _ = fmt.Fprintf(writer, "%s ", msg)
    		var response string
    		_, err := fmt.Scanln(&response)
    		if err != nil {
    			return false
    		}
    		switch strings.ToUpper(response) {
    		case "Y", "YES":
    			return true
    		case "N", "NO":
    			return false
    		}
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 15 15:02:17 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  5. src/encoding/gob/example_encdec_test.go

    }
    
    // UnmarshalBinary modifies the receiver so it must take a pointer receiver.
    func (v *Vector) UnmarshalBinary(data []byte) error {
    	// A simple encoding: plain text.
    	b := bytes.NewBuffer(data)
    	_, err := fmt.Fscanln(b, &v.x, &v.y, &v.z)
    	return err
    }
    
    // This example transmits a value that implements the custom encoding and decoding methods.
    func Example_encodeDecode() {
    	var network bytes.Buffer // Stand-in for the network.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 1.5K bytes
    - Viewed (0)
  6. operator/cmd/mesh/shared.go

    }
    
    // Confirm waits for a user to confirm with the supplied message.
    func Confirm(msg string, writer io.Writer) bool {
    	for {
    		_, _ = fmt.Fprintf(writer, "%s ", msg)
    		var response string
    		_, err := fmt.Scanln(&response)
    		if err != nil {
    			return false
    		}
    		switch strings.ToUpper(response) {
    		case "Y", "YES":
    			return true
    		case "N", "NO":
    			return false
    		}
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Mar 29 02:29:02 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection_test.go

    	// regular messages.
    	in := "foo"
    	if _, err := fmt.Fprintln(clSPDYStream, in); err != nil {
    		t.Fatalf("client: error writing data to stream: %v", err)
    	}
    	var out string
    	if _, err := fmt.Fscanln(clSPDYStream, &out); err != nil {
    		t.Fatalf("client: error reading data from stream: %v", err)
    	}
    	if in != out {
    		t.Errorf("client: received data doesn't match sent data: got %q, want %q", out, in)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 01 11:58:57 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  8. src/fmt/example_test.go

    	// 5 true gophers
    	// 3
    }
    
    func ExampleFscanln() {
    	s := `dmr 1771 1.61803398875
    	ken 271828 3.14159`
    	r := strings.NewReader(s)
    	var a string
    	var b int
    	var c float64
    	for {
    		n, err := fmt.Fscanln(r, &a, &b, &c)
    		if err == io.EOF {
    			break
    		}
    		if err != nil {
    			panic(err)
    		}
    		fmt.Printf("%d: %s, %d, %f\n", n, a, b, c)
    	}
    	// Output:
    	// 3: dmr, 1771, 1.618034
    	// 3: ken, 271828, 3.141590
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 21:03:10 UTC 2019
    - 11.8K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"Fprintf", Func, 0},
    		{"Fprintln", Func, 0},
    		{"Fscan", Func, 0},
    		{"Fscanf", Func, 0},
    		{"Fscanln", Func, 0},
    		{"GoStringer", Type, 0},
    		{"Print", Func, 0},
    		{"Printf", Func, 0},
    		{"Println", Func, 0},
    		{"Scan", Func, 0},
    		{"ScanState", Type, 0},
    		{"Scanf", Func, 0},
    		{"Scanln", Func, 0},
    		{"Scanner", Type, 0},
    		{"Sprint", Func, 0},
    		{"Sprintf", Func, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  10. cmd/common-main.go

    			fmt.Println("Refer to the docs here on how to run it as a Windows Service https://github.com/minio/minio-service/tree/master/windows")
    			fmt.Println("Press the Enter Key to Exit")
    			fmt.Scanln()
    			os.Exit(1)
    		}
    	}
    
    	logger.Init(GOPATH, GOROOT)
    	logger.RegisterError(config.FmtError)
    
    	globalBatchJobsMetrics = batchJobMetrics{metrics: make(map[string]*batchJobInfo)}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 30 11:58:12 UTC 2024
    - 31.5K bytes
    - Viewed (0)
Back to top