Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 76 for newScanner (0.37 sec)

  1. test/fixedbugs/issue50169.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    func main() {
    	var x Value
    	NewScanner().Scan(x)
    }
    
    type Value any
    
    type Scanner interface{ Scan(any) error }
    
    func NewScanner() Scanner {
    	return &t{}
    }
    
    type t struct{}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 15 20:26:03 UTC 2021
    - 407 bytes
    - Viewed (0)
  2. src/mime/type_plan9.go

    		".pNg": "image/png",
    	}
    }
    
    func loadMimeFile(filename string) {
    	f, err := os.Open(filename)
    	if err != nil {
    		return
    	}
    	defer f.Close()
    
    	scanner := bufio.NewScanner(f)
    	for scanner.Scan() {
    		fields := strings.Fields(scanner.Text())
    		if len(fields) <= 2 || fields[0][0] != '.' {
    			continue
    		}
    		if fields[1] == "-" || fields[2] == "-" {
    			continue
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 15 19:56:08 UTC 2016
    - 1K bytes
    - Viewed (0)
  3. src/mime/type_unix.go

    	"/etc/httpd/conf/mime.types",
    }
    
    func loadMimeGlobsFile(filename string) error {
    	f, err := os.Open(filename)
    	if err != nil {
    		return err
    	}
    	defer f.Close()
    
    	scanner := bufio.NewScanner(f)
    	for scanner.Scan() {
    		// Each line should be of format: weight:mimetype:glob[:morefields...]
    		fields := strings.Split(scanner.Text(), ":")
    		if len(fields) < 3 || len(fields[0]) < 1 || len(fields[2]) < 3 {
    			continue
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 3K bytes
    - Viewed (0)
  4. src/go/internal/gccgoimporter/gccgoinstallation.go

    	cmd := exec.Command(gccgoPath, argv...)
    	stderr, err := cmd.StderrPipe()
    	if err != nil {
    		return
    	}
    
    	err = cmd.Start()
    	if err != nil {
    		return
    	}
    
    	scanner := bufio.NewScanner(stderr)
    	for scanner.Scan() {
    		line := scanner.Text()
    		switch {
    		case strings.HasPrefix(line, "Target: "):
    			inst.TargetTriple = line[8:]
    
    		case line[0] == ' ':
    			args := strings.Fields(line)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 17:49:12 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  5. src/encoding/json/indent.go

    	b := dst.AvailableBuffer()
    	b, err := appendCompact(b, src, false)
    	dst.Write(b)
    	return err
    }
    
    func appendCompact(dst, src []byte, escape bool) ([]byte, error) {
    	origLen := len(dst)
    	scan := newScanner()
    	defer freeScanner(scan)
    	start := 0
    	for i, c := range src {
    		if escape && (c == '<' || c == '>' || c == '&') {
    			if start < i {
    				dst = append(dst, src[start:i]...)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 20:19:31 UTC 2023
    - 5.4K bytes
    - Viewed (0)
  6. src/cmd/internal/obj/x86/obj6_test.go

    	marker_to_expected map[int][]string
    	marker_to_output   map[int][]string
    }
    
    const marker_start = 1234
    
    func parseTestData(t *testing.T) *ParsedTestData {
    	r := &ParsedTestData{}
    	scanner := bufio.NewScanner(strings.NewReader(testdata))
    	r.marker_to_input = make(map[int][]string)
    	r.marker_to_expected = make(map[int][]string)
    	marker := marker_start
    	input_insns := []string{}
    	for scanner.Scan() {
    		line := scanner.Text()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 15 20:21:30 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  7. src/internal/sysinfo/cpuinfo_linux.go

    	cpuMHz := ""
    
    	// The 512-byte buffer is enough to hold the contents of CPU0
    	buf := make([]byte, 512)
    	err := readLinuxProcCPUInfo(buf)
    	if err != nil {
    		return ""
    	}
    
    	scanner := bufio.NewScanner(bytes.NewReader(buf))
    	for scanner.Scan() {
    		key, value, found := strings.Cut(scanner.Text(), ": ")
    		if !found {
    			continue
    		}
    		switch strings.TrimSpace(key) {
    		case "Model Name", "model name":
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 18:42:42 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  8. pkg/test/framework/errors/deprecations.go

    // a DeprecatedError. Use `extraInfo` to pass additional info, like pod namespace/name, etc.
    func FindDeprecatedMessagesInEnvoyLog(logs, extraInfo string) error {
    	scanner := bufio.NewScanner(strings.NewReader(logs))
    	for scanner.Scan() {
    		line := scanner.Text()
    		if strings.Contains(strings.ToLower(line), "deprecated") {
    			if len(extraInfo) > 0 {
    				extraInfo = fmt.Sprintf(" (%s)", extraInfo)
    			}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  9. src/cmd/internal/obj/stringer.go

    	if err != nil {
    		log.Fatal(err)
    	}
    	fd, err := os.Create(*output)
    	if err != nil {
    		log.Fatal(err)
    	}
    	out := bufio.NewWriter(fd)
    	defer out.Flush()
    	var on = false
    	s := bufio.NewScanner(in)
    	first := true
    	for s.Scan() {
    		line := s.Text()
    		if !on {
    			// First relevant line contains "= obj.ABase".
    			// If we find it, delete the = so we don't stop immediately.
    			const prefix = "= obj.ABase"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  10. src/cmd/internal/pgo/deserialize.go

    }
    
    // FromSerialized parses a profile from serialization output of Profile.WriteTo.
    func FromSerialized(r io.Reader) (*Profile, error) {
    	d := emptyProfile()
    
    	scanner := bufio.NewScanner(r)
    	scanner.Split(bufio.ScanLines)
    
    	if !scanner.Scan() {
    		if err := scanner.Err(); err != nil {
    			return nil, fmt.Errorf("error reading preprocessed profile: %w", err)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 20:20:01 UTC 2024
    - 2.7K bytes
    - Viewed (0)
Back to top