- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 46 for newScanner (0.2 sec)
-
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) -
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) -
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) -
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) -
tools/istio-iptables/pkg/dependencies/stub.go
// We are either getting iptables rules as a `stdin` blob in `iptables-save` format (if this is a restore) if stdin != nil { buf := bufio.NewScanner(stdin) for buf.Scan() { stdincmd := buf.Text() s.ExecutedAll = append(s.ExecutedAll, stdincmd) s.ExecutedStdin = append(s.ExecutedStdin, stdincmd) } } else { // ...or as discrete individual commands
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Mar 11 17:46:23 UTC 2024 - 3.4K bytes - Viewed (0) -
src/internal/trace/testtrace/expectation.go
} return nil } // ParseExpectation parses the serialized form of an Expectation. func ParseExpectation(data []byte) (*Expectation, error) { exp := new(Expectation) s := bufio.NewScanner(bytes.NewReader(data)) if s.Scan() { c := strings.SplitN(s.Text(), " ", 2) switch c[0] { case "SUCCESS": case "FAILURE": exp.failure = true if len(c) != 2 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:48:18 UTC 2024 - 2.3K bytes - Viewed (0) -
docs/debugging/pprofgoparser/main.go
} bf := bytes.Buffer{} save := func(s string) { bf.WriteString(s + "\n") } reset := func() { bf.Reset() } ret := make(map[time.Duration][]string) s := bufio.NewScanner(f) s.Split(bufio.ScanLines) var ( t time.Duration skip, record bool ) for s.Scan() { line := s.Text() switch { case skip && line != "": case skip && line == "":
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Wed Mar 06 11:43:16 UTC 2024 - 3.4K bytes - Viewed (0) -
src/cmd/compile/internal/ssa/debug_lines_test.go
// this is an inlining reporting test, not an optimization test. -N makes it less fragile dumpBytes := compileAndDump(t, file, function, "-N") dump := bufio.NewScanner(bytes.NewReader(dumpBytes)) dumpLineNum := 0 var gotStmts []int var gotStacks [][]int for dump.Scan() { line := dump.Text() dumpLineNum++ matches := inlineLine.FindStringSubmatch(line)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Nov 21 20:24:52 UTC 2023 - 8.4K bytes - Viewed (0) -
hack/conformance/check_conformance_test_requirements.go
regSkip := regexp.MustCompile(patternSkip) fileInput, err := os.ReadFile(e2eFile) if err != nil { return fmt.Errorf("Failed to read file %s: %w", e2eFile, err) } scanner := bufio.NewScanner(bytes.NewReader(fileInput)) scanner.Split(bufio.ScanLines) for scanner.Scan() { line := scanner.Text() if regStartConformance.MatchString(line) { if inConformanceCode {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Sep 29 06:30:57 UTC 2023 - 4.1K bytes - Viewed (0) -
src/internal/trace/raw/textreader.go
names map[string]event.Type s *bufio.Scanner } // NewTextReader creates a new reader for the trace text format. func NewTextReader(r io.Reader) (*TextReader, error) { tr := &TextReader{s: bufio.NewScanner(r)} line, err := tr.nextLine() if err != nil { return nil, err } trace, line := readToken(line) if trace != "Trace" { return nil, fmt.Errorf("failed to parse header") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:48:18 UTC 2024 - 4.9K bytes - Viewed (0)