Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37181bb

Browse files
committed
Removed strings.Builder which was a go 1.10 feature.Closes#47
1 parent7ad299e commit37181bb

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

‎pipeline/build_golang_test.go‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package pipeline
22

33
import (
4+
"bytes"
45
"context"
56
"fmt"
67
"io/ioutil"
@@ -112,10 +113,10 @@ func TestExecuteBuildFailPipelineBuild(t *testing.T) {
112113
}()
113114
gaia.Cfg=new(gaia.Config)
114115
gaia.Cfg.HomePath=tmp
115-
varlogOutput strings.Builder
116+
buf:=new(bytes.Buffer)
116117
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
117118
Level:hclog.Trace,
118-
Output:&logOutput,
119+
Output:buf,
119120
Name:"Gaia",
120121
})
121122
b:=new(BuildPipelineGolang)
@@ -142,10 +143,10 @@ func TestExecuteBuildContextTimeout(t *testing.T) {
142143
gaia.Cfg=new(gaia.Config)
143144
gaia.Cfg.HomePath=tmp
144145
// Initialize shared logger
145-
varlogOutput strings.Builder
146+
buf:=new(bytes.Buffer)
146147
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
147148
Level:hclog.Trace,
148-
Output:&logOutput,
149+
Output:buf,
149150
Name:"Gaia",
150151
})
151152
b:=new(BuildPipelineGolang)
@@ -164,10 +165,10 @@ func TestExecuteBuildBinaryNotFoundError(t *testing.T) {
164165
gaia.Cfg=new(gaia.Config)
165166
gaia.Cfg.HomePath=tmp
166167
// Initialize shared logger
167-
varlogOutput strings.Builder
168+
buf:=new(bytes.Buffer)
168169
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
169170
Level:hclog.Trace,
170-
Output:&logOutput,
171+
Output:buf,
171172
Name:"Gaia",
172173
})
173174
currentPath:=os.Getenv("PATH")
@@ -189,10 +190,10 @@ func TestCopyBinary(t *testing.T) {
189190
gaia.Cfg=new(gaia.Config)
190191
gaia.Cfg.HomePath=tmp
191192
// Initialize shared logger
192-
varlogOutput strings.Builder
193+
buf:=new(bytes.Buffer)
193194
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
194195
Level:hclog.Trace,
195-
Output:&logOutput,
196+
Output:buf,
196197
Name:"Gaia",
197198
})
198199
b:=new(BuildPipelineGolang)
@@ -224,10 +225,10 @@ func TestCopyBinarySrcDoesNotExist(t *testing.T) {
224225
gaia.Cfg=new(gaia.Config)
225226
gaia.Cfg.HomePath=tmp
226227
// Initialize shared logger
227-
varlogOutput strings.Builder
228+
buf:=new(bytes.Buffer)
228229
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
229230
Level:hclog.Trace,
230-
Output:&logOutput,
231+
Output:buf,
231232
Name:"Gaia",
232233
})
233234
b:=new(BuildPipelineGolang)

‎pipeline/git_test.go‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package pipeline
22

33
import (
4+
"bytes"
45
"os"
56
"strconv"
67
"strings"
@@ -28,10 +29,10 @@ func TestUpdateAllPipelinesRepositoryNotFound(t *testing.T) {
2829
gaia.Cfg=new(gaia.Config)
2930
gaia.Cfg.HomePath=tmp
3031
// Initialize shared logger
31-
varb strings.Builder
32+
b:=new(bytes.Buffer)
3233
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
3334
Level:hclog.Trace,
34-
Output:&b,
35+
Output:b,
3536
Name:"Gaia",
3637
})
3738

@@ -49,10 +50,10 @@ func TestUpdateAllPipelinesAlreadyUpToDate(t *testing.T) {
4950
gaia.Cfg=new(gaia.Config)
5051
gaia.Cfg.HomePath="tmp"
5152
// Initialize shared logger
52-
varb strings.Builder
53+
b:=new(bytes.Buffer)
5354
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
5455
Level:hclog.Trace,
55-
Output:&b,
56+
Output:b,
5657
Name:"Gaia",
5758
})
5859
repo:=&gaia.GitRepo{
@@ -82,10 +83,10 @@ func TestUpdateAllPipelinesAlreadyUpToDateWithMoreThanOnePipeline(t *testing.T)
8283
gaia.Cfg=new(gaia.Config)
8384
gaia.Cfg.HomePath="tmp"
8485
// Initialize shared logger
85-
varb strings.Builder
86+
b:=new(bytes.Buffer)
8687
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
8788
Level:hclog.Trace,
88-
Output:&b,
89+
Output:b,
8990
Name:"Gaia",
9091
})
9192
repo:=&gaia.GitRepo{
@@ -124,10 +125,10 @@ func TestUpdateAllPipelinesHundredPipelines(t *testing.T) {
124125
gaia.Cfg=new(gaia.Config)
125126
gaia.Cfg.HomePath="tmp"
126127
// Initialize shared logger
127-
varb strings.Builder
128+
b:=new(bytes.Buffer)
128129
gaia.Cfg.Logger=hclog.New(&hclog.LoggerOptions{
129130
Level:hclog.Trace,
130-
Output:&b,
131+
Output:b,
131132
Name:"Gaia",
132133
})
133134
repo:=&gaia.GitRepo{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp