wip
This commit is contained in:
parent
5a1a4a1eec
commit
8e1b3a178a
|
|
@ -13,6 +13,10 @@ issues:
|
||||||
linters:
|
linters:
|
||||||
- dupl
|
- dupl
|
||||||
- lll
|
- lll
|
||||||
|
- path: (.+)_test.go
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- lll
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
disable-all: true
|
||||||
enable:
|
enable:
|
||||||
|
|
@ -26,7 +30,7 @@ linters:
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- lll
|
#- lll
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- prealloc
|
- prealloc
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,11 @@ func (in *SecurityValidator) download() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer out.Close()
|
defer func() {
|
||||||
|
if err := out.Close(); err != nil {
|
||||||
|
jenkinslog.V(log.VDebug).Info("Failed to close file", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
req, err := http.NewRequest(http.MethodGet, Hosturl, nil)
|
req, err := http.NewRequest(http.MethodGet, Hosturl, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -286,6 +290,10 @@ func (in *SecurityValidator) download() error {
|
||||||
|
|
||||||
defer response.Body.Close()
|
defer response.Body.Close()
|
||||||
|
|
||||||
|
if err := out.Close(); err != nil {
|
||||||
|
jenkinslog.V(log.VDebug).Info("Failed to send file", err)
|
||||||
|
}
|
||||||
|
|
||||||
_, err = io.Copy(out, response.Body)
|
_, err = io.Copy(out, response.Body)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,11 +166,11 @@ func TestSMTP_Send(t *testing.T) {
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
ts := &testServer{event: e}
|
//ts := &testServer{event: e}
|
||||||
|
|
||||||
// Create fake SMTP server
|
// Create fake SMTP server
|
||||||
|
|
||||||
s := smtp.NewServer(ts)
|
s := smtp.NewServer()
|
||||||
|
|
||||||
s.Addr = fmt.Sprintf(":%d", testSMTPPort)
|
s.Addr = fmt.Sprintf(":%d", testSMTPPort)
|
||||||
s.Domain = "localhost"
|
s.Domain = "localhost"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue