summaryrefslogtreecommitdiffstats
path: root/matterclient
diff options
context:
space:
mode:
authorDuco van Amstel <duco.vanamstel@gmail.com>2018-12-05 23:40:55 +0000
committerWim <wim@42.be>2018-12-06 00:40:55 +0100
commitaf7a00d030b89a0fa1c85da8f3a1485c8a757fa1 (patch)
treee7d2a3e0f309eca268f4ff3599468c5af94d169a /matterclient
parent8a7efce941acf7123481d58c6bf5b5421c25736d (diff)
downloadmatterbridge-msglm-af7a00d030b89a0fa1c85da8f3a1485c8a757fa1.tar.gz
matterbridge-msglm-af7a00d030b89a0fa1c85da8f3a1485c8a757fa1.tar.bz2
matterbridge-msglm-af7a00d030b89a0fa1c85da8f3a1485c8a757fa1.zip
Enable gosec linter (#645)
Diffstat (limited to 'matterclient')
-rw-r--r--matterclient/helpers.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/matterclient/helpers.go b/matterclient/helpers.go
index 74936abf..05497311 100644
--- a/matterclient/helpers.go
+++ b/matterclient/helpers.go
@@ -1,7 +1,7 @@
package matterclient
import (
- "crypto/md5"
+ "crypto/md5" //nolint:gosec
"crypto/tls"
"errors"
"fmt"
@@ -101,7 +101,10 @@ func (m *MMClient) initClient(firstConnection bool, b *backoff.Backoff) error {
}
// login to mattermost
m.Client = model.NewAPIv4Client(uriScheme + m.Credentials.Server)
- m.Client.HttpClient.Transport = &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}, Proxy: http.ProxyFromEnvironment}
+ m.Client.HttpClient.Transport = &http.Transport{
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}, //nolint:gosec
+ Proxy: http.ProxyFromEnvironment,
+ }
m.Client.HttpClient.Timeout = time.Second * 10
// handle MMAUTHTOKEN and personal token
@@ -206,7 +209,10 @@ func (m *MMClient) wsConnect() {
m.log.Debugf("WsClient: making connection: %s", wsurl)
for {
- wsDialer := &websocket.Dialer{Proxy: http.ProxyFromEnvironment, TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}}
+ wsDialer := &websocket.Dialer{
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}, //nolint:gosec
+ Proxy: http.ProxyFromEnvironment,
+ }
var err error
m.WsClient, _, err = wsDialer.Dial(wsurl, header)
if err != nil {
@@ -273,5 +279,5 @@ func supportedVersion(version string) bool {
}
func digestString(s string) string {
- return fmt.Sprintf("%x", md5.Sum([]byte(s)))
+ return fmt.Sprintf("%x", md5.Sum([]byte(s))) //nolint:gosec
}