Skip to content

Commit 4629c6b

Browse files
authored
Merge pull request #742 from devlights/add-result-in-example
2 parents 664b3cf + 04ea9b7 commit 4629c6b

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

examples/basic/scannerop/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
このディレクトリには以下のサンプルがあります。
44

5-
| file | example name | note |
6-
|-----------|-------------------|------------------------------------------------------|
7-
| basic.go | scannerop\_basic | bufio.Scannerの基本的な使い方についてのサンプルです |
8-
| custom.go | scannerop\_custom | bufio.Scanner に 独自の bufio.SplitFunc を指定して処理するサンプルです. |
5+
| file | example name | note |
6+
| --------- | ---------------- | ----------------------------------------------------------------------- |
7+
| basic.go | scannerop_basic | bufio.Scannerの基本的な使い方についてのサンプルです |
8+
| custom.go | scannerop_custom | bufio.Scanner に 独自の bufio.SplitFunc を指定して処理するサンプルです. |

examples/basic/scannerop/basic.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,22 @@ func Basic() error {
2626
fmt.Println("END")
2727

2828
return nil
29+
30+
/*
31+
$ task
32+
task: Task "build" is up to date
33+
task: [run] ./try-golang -onetime
34+
35+
ENTER EXAMPLE NAME: scannerop_basic
36+
37+
[Name] "scannerop_basic"
38+
Enter: helloworld
39+
helloworld
40+
Enter: quit
41+
END
42+
43+
44+
[Elapsed] 4.979184142s
45+
*/
46+
2947
}

examples/basic/scannerop/custom.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,24 @@ func Custom() error {
5454
}
5555

5656
return nil
57+
58+
/*
59+
$ task
60+
task: [build] go build .
61+
task: [run] ./try-golang -onetime
62+
63+
ENTER EXAMPLE NAME: scannerop_custom
64+
65+
[Name] "scannerop_custom"
66+
[0] hello[TAB]world[TAB]こんにちわ{TAB}世界
67+
[1] hello
68+
[1] world
69+
[1] こんにちわ{TAB}世界
70+
[2] hello[TAB]world[TAB]こんにちわ
71+
[2] 世界
72+
73+
74+
[Elapsed] 99µs
75+
*/
76+
5777
}

0 commit comments

Comments
 (0)