- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for NewReader (0.14 sec)
-
src/archive/tar/example_test.go
if _, err := tw.Write([]byte(file.Body)); err != nil { log.Fatal(err) } } if err := tw.Close(); err != nil { log.Fatal(err) } // Open and iterate through the files in the archive. tr := tar.NewReader(&buf) for { hdr, err := tr.Next() if err == io.EOF { break // End of archive } if err != nil { log.Fatal(err) } fmt.Printf("Contents of %s:\n", hdr.Name)
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Nov 16 16:54:08 GMT 2017 - 1.4K bytes - Viewed (0) -
src/bufio/example_test.go
fmt.Fprintln(os.Stderr, "reading standard input:", err) } } // Return the most recent call to Scan as a []byte. func ExampleScanner_Bytes() { scanner := bufio.NewScanner(strings.NewReader("gopher")) for scanner.Scan() { fmt.Println(len(scanner.Bytes()) == 6) } if err := scanner.Err(); err != nil { fmt.Fprintln(os.Stderr, "shouldn't see an error scanning a string") } // Output: // true
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Oct 23 09:06:30 GMT 2023 - 4.9K bytes - Viewed (0)