Skip to content

Commit 6425932

Browse files
authored
Merge pull request #724 from devlights:add-result-in-example
Add results in examples
2 parents b2806e8 + 6bb77dd commit 6425932

File tree

5 files changed

+81
-0
lines changed

5 files changed

+81
-0
lines changed

examples/basic/hexop/decode.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,21 @@ func Decode() error {
2727
output.Stdoutl("decoded ", string(dst))
2828

2929
return nil
30+
31+
/*
32+
$ task
33+
task: [build] go build .
34+
task: [run] ./try-golang -onetime
35+
36+
ENTER EXAMPLE NAME: hexop_decode
37+
38+
[Name] "hexop_decode"
39+
original 68656c6c6f20776f726c64
40+
dec-len 11
41+
decoded hello world
42+
43+
44+
[Elapsed] 35.809µs
45+
*/
46+
3047
}

examples/basic/hexop/decoder.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,20 @@ func Decoder() error {
2323
output.Stdoutl("decoded ", string(dst))
2424

2525
return nil
26+
27+
/*
28+
$ task
29+
task: [build] go build .
30+
task: [run] ./try-golang -onetime
31+
32+
ENTER EXAMPLE NAME: hexop_decoder
33+
34+
[Name] "hexop_decoder"
35+
original 68656c6c6f20776f726c64
36+
decoded hello world
37+
38+
39+
[Elapsed] 19.38µs
40+
*/
41+
2642
}

examples/basic/hexop/dumper.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,19 @@ func Dumper() error {
3131
}
3232

3333
return nil
34+
35+
/*
36+
$ task
37+
task: [build] go build .
38+
task: [run] ./try-golang -onetime
39+
40+
ENTER EXAMPLE NAME: hexop_dumper
41+
42+
[Name] "hexop_dumper"
43+
00000000 68 65 6c 6c 6f 20 77 6f 72 6c 64 |hello world|
44+
45+
46+
[Elapsed] 48.25µs
47+
*/
48+
3449
}

examples/basic/hexop/encode.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,21 @@ func Encode() error {
2727
output.Stdoutl("encoded ", string(dst))
2828

2929
return nil
30+
31+
/*
32+
$ task
33+
task: Task "build" is up to date
34+
task: [run] ./try-golang -onetime
35+
36+
ENTER EXAMPLE NAME: hexop_encode
37+
38+
[Name] "hexop_encode"
39+
original hello world
40+
enc-len 22
41+
encoded 68656c6c6f20776f726c64
42+
43+
44+
[Elapsed] 23.54µs
45+
*/
46+
3047
}

examples/basic/hexop/encoder.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,20 @@ func Encoder() error {
2626
output.Stdoutl("encoded ", buf.String())
2727

2828
return nil
29+
30+
/*
31+
$ task
32+
task: [build] go build .
33+
task: [run] ./try-golang -onetime
34+
35+
ENTER EXAMPLE NAME: hexop_encoder
36+
37+
[Name] "hexop_encoder"
38+
original hello world
39+
encoded 68656c6c6f20776f726c64
40+
41+
42+
[Elapsed] 17.57µs
43+
*/
44+
2945
}

0 commit comments

Comments
 (0)