- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 63 for newScanner (0.18 sec)
-
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) -
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/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) -
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) -
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) -
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) -
src/runtime/internal/wasitest/nonblock_test.go
pr, pw := io.Pipe() defer pw.Close() subProcess.Stderr = pw if err := subProcess.Start(); err != nil { t.Fatal(err) } scanner := bufio.NewScanner(pr) if !scanner.Scan() { t.Fatal("expected line:", scanner.Err()) } else if scanner.Text() != "waiting" { t.Fatal("unexpected output:", scanner.Text()) } for _, fifo := range fifos {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jun 29 15:35:27 UTC 2023 - 2.4K 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)