Skip to content

Commit aa98ffe

Browse files
authored
Merge pull request #726 from devlights:add-result-in-examples
Add Result in examples
2 parents 4f029eb + 0fb0a0d commit aa98ffe

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

examples/basic/internalpkg/internalpkg_basic.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,21 @@ func Basic() error {
6363
output.Stdoutl("[From (4) to (2)]", b.B())
6464

6565
return nil
66+
67+
/*
68+
$ task
69+
task: Task "build" is up to date
70+
task: [run] ./try-golang -onetime
71+
72+
ENTER EXAMPLE NAME: internalpkg_basic
73+
74+
[Name] "internalpkg_basic"
75+
[From (1) to (2)] InternalPkgSub1
76+
[From (2) to (3)] InternalPkgSub2
77+
[From (4) to (2)] INTERNALPKGSUB1
78+
79+
80+
[Elapsed] 20.83µs
81+
*/
82+
6683
}

examples/basic/ioop/limitread.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,20 @@ func LimitRead() error {
4545
}
4646

4747
return nil
48+
49+
/*
50+
$ task
51+
task: [build] go build .
52+
task: [run] ./try-golang -onetime
53+
54+
ENTER EXAMPLE NAME: ioop_limit_read
55+
56+
[Name] "ioop_limit_read"
57+
[LimitReader] original: hello world
58+
[LimitRead] 4 byte(s) read: hell
59+
60+
61+
[Elapsed] 22.76µs
62+
*/
63+
4864
}

examples/basic/ioop/onebyteread.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,29 @@ func OneByteRead() error {
4444
}
4545

4646
return nil
47+
48+
/*
49+
$ task
50+
task: Task "build" is up to date
51+
task: [run] ./try-golang -onetime
52+
53+
ENTER EXAMPLE NAME: ioop_onebyte_read
54+
55+
[Name] "ioop_onebyte_read"
56+
[OneByte] 1 byte read: h
57+
[OneByte] 1 byte read: e
58+
[OneByte] 1 byte read: l
59+
[OneByte] 1 byte read: l
60+
[OneByte] 1 byte read: o
61+
[OneByte] 1 byte read:
62+
[OneByte] 1 byte read: w
63+
[OneByte] 1 byte read: o
64+
[OneByte] 1 byte read: r
65+
[OneByte] 1 byte read: l
66+
[OneByte] 1 byte read: d
67+
68+
69+
[Elapsed] 100.72µs
70+
*/
71+
4772
}

0 commit comments

Comments
 (0)