Skip to content

Commit 8d3da4f

Browse files
authored
Merge pull request #765 from devlights/add-result-in-example
2 parents 60b9169 + 0ce7cb2 commit 8d3da4f

File tree

5 files changed

+57
-6
lines changed

5 files changed

+57
-6
lines changed

.gitpod.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ RUN curl -fsSL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar
2121
printf '%s\n' 'export GOPATH=/workspace/go' \
2222
'export PATH=$GOPATH/bin:$PATH' > $HOME/.bashrc.d/300-go
2323

24-
RUN sudo apt update && sudo apt install -y universal-ctags tree nkf
24+
RUN sudo apt update && sudo apt install -y universal-ctags tree nkf wamerican
2525

examples/basic/streams/README.md

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

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

5-
| file | example name | note |
6-
|---------------------|--------------------|---------------------------|
7-
| using\_nopcloser.go | streams\_nopcloser | io.NopCloser についてのサンプルです. |
8-
9-
5+
| file | example name | note |
6+
| ------------------ | ------------------- | ------------------------------------ |
7+
| using_nopcloser.go | streams_nopcloser | io.NopCloser についてのサンプルです. |
8+
| basic.go | streams_pipe_basic | io.Pipe の基本的なサンプルです. |
9+
| basic2.go | streams_pipe_basic2 | io.Pipe() のサンプルです。 |

examples/basic/streams/pipes/basic.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,22 @@ func Basic() error {
102102
io.Copy(filterW, pr)
103103

104104
return nil
105+
106+
/*
107+
$ task
108+
task: Task "build" is up to date
109+
task: [run] ./try-golang -onetime
110+
111+
ENTER EXAMPLE NAME: streams_pipe_basic
112+
113+
[Name] "streams_pipe_basic"
114+
WARS
115+
WARSHIP
116+
WARSHIP'S
117+
WARSHIPS
118+
119+
120+
[Elapsed] 108.994024ms
121+
*/
122+
105123
}

examples/basic/streams/pipes/basic2.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,19 @@ func Basic2() error {
7575
}
7676

7777
return nil
78+
79+
/*
80+
$ task
81+
task: [build] go build .
82+
task: [run] ./try-golang -onetime
83+
84+
ENTER EXAMPLE NAME: streams_pipe_basic2
85+
86+
[Name] "streams_pipe_basic2"
87+
[pr] helloworld
88+
89+
90+
[Elapsed] 252.58µs
91+
*/
92+
7893
}

examples/basic/streams/using_nopcloser.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,22 @@ func UsingNopCloser() error {
5858
_ = reader.Close()
5959

6060
return nil
61+
62+
/*
63+
$ task
64+
task: Task "build" is up to date
65+
task: [run] ./try-golang -onetime
66+
67+
ENTER EXAMPLE NAME: streams_nopcloser
68+
69+
[Name] "streams_nopcloser"
70+
[nopcloser.Read] [104 101 108]
71+
>> before NopCloser.Close
72+
>> after NopCloser.Close
73+
[_readcloserimpl] Close() called
74+
75+
76+
[Elapsed] 36.09µs
77+
*/
78+
6179
}

0 commit comments

Comments
 (0)