Skip to content

Commit f102fb8

Browse files
committed
Add result in examples (examples/basic/byteop)
1 parent 5d8f791 commit f102fb8

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

examples/basic/byteop/cut_prefix_suffix.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,20 @@ func CutPrefixSuffix() error {
3737
output.Stdoutl("[CutSuffix]", cut2, string(cut2))
3838

3939
return nil
40+
41+
/*
42+
$ task
43+
task: Task "build" is up to date
44+
task: [run] ./try-golang -onetime
45+
46+
ENTER EXAMPLE NAME: byteop_cut_prefix_suffix
47+
48+
[Name] "byteop_cut_prefix_suffix"
49+
[CutPrefix] [49 50 51 52 53 119 111 114 108 100] 12345world
50+
[CutSuffix] [104 101 108 108 111 49 50 51 52 53] hello12345
51+
52+
53+
[Elapsed] 53.02µs
54+
*/
55+
4056
}

examples/basic/byteop/reader_from_byteslice.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,31 @@ func ReaderFromByteSlice() error {
7070
}
7171

7272
return nil
73+
74+
/*
75+
$ task
76+
task: [build] go build .
77+
task: [run] ./try-golang -onetime
78+
79+
ENTER EXAMPLE NAME: byteop_reader_from_byteslice
80+
81+
[Name] "byteop_reader_from_byteslice"
82+
[io.Reader] 49
83+
[io.Reader] 50
84+
[io.Reader] 51
85+
[io.Reader] 52
86+
[io.Reader] 53
87+
[io.ByteReader] 49
88+
[io.ByteReader] 50
89+
[io.ByteReader] 51
90+
[io.ByteReader] 52
91+
[io.ByteReader] 53
92+
[io.ReaderAt] [51 52 53]
93+
12345
94+
95+
[Elapsed] 133.07µs
96+
*/
97+
7398
}
7499

75100
func backToStart(s io.Seeker) error {

0 commit comments

Comments
 (0)