aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-06-06 05:25:23 +0700
committerShulhan <m.shulhan@gmail.com>2020-06-06 05:25:42 +0700
commitb1133f25df3ec38b503e1ea6129ea6b3397968bb (patch)
tree53a2c6755c6a2e0d9ed13b84603e5b8bcd2e3ee0 /lib/ssh
parent8661178b08ce640d7c24aec8465802e4d5160e2a (diff)
downloadpakakeh.go-b1133f25df3ec38b503e1ea6129ea6b3397968bb.tar.xz
all: use default linter options
Diffstat (limited to 'lib/ssh')
-rw-r--r--lib/ssh/client.go4
-rw-r--r--lib/ssh/config.go3
-rw-r--r--lib/ssh/config_parser_test.go2
-rw-r--r--lib/ssh/ssh_test.go1
4 files changed, 3 insertions, 7 deletions
diff --git a/lib/ssh/client.go b/lib/ssh/client.go
index 0e360e62..d3ae9af6 100644
--- a/lib/ssh/client.go
+++ b/lib/ssh/client.go
@@ -36,7 +36,7 @@ func NewClient(cfg *ConfigSection) (cl *Client, err error) {
Auth: []ssh.AuthMethod{
ssh.PublicKeys(cfg.signers...),
},
- HostKeyCallback: ssh.InsecureIgnoreHostKey(), //nolint:gosec
+ HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
cl = &Client{
@@ -101,7 +101,6 @@ func (cl *Client) Get(remote, local string) (err error) {
remote = fmt.Sprintf("%s@%s:%s", cl.cfg.User, cl.cfg.Hostname, remote)
- //nolint: gosec
cmd := exec.Command("scp", "-r", "-i", cl.cfg.privateKeyFile,
"-P", cl.cfg.stringPort, remote, local)
@@ -135,7 +134,6 @@ func (cl *Client) Put(local, remote string) (err error) {
remote = fmt.Sprintf("%s@%s:%s", cl.cfg.User, cl.cfg.Hostname, remote)
- //nolint: gosec
cmd := exec.Command("scp", "-r", "-i", cl.cfg.privateKeyFile,
"-P", cl.cfg.stringPort, local, remote)
diff --git a/lib/ssh/config.go b/lib/ssh/config.go
index 9ea9a1c2..f8b83561 100644
--- a/lib/ssh/config.go
+++ b/lib/ssh/config.go
@@ -46,7 +46,7 @@ const (
)
//TODO: list of keys that are not implemented.
-//nolint:varcheck,deadcode
+//nolint: deadcode,varcheck
const (
keyCiphers = "ciphers"
keyControlMaster = "controlmaster"
@@ -129,7 +129,6 @@ type Config struct {
//
// NewConfig load SSH configuration from file.
//
-//nolint: gocyclo
func NewConfig(file string) (cfg *Config, err error) {
if len(file) == 0 {
return nil, nil
diff --git a/lib/ssh/config_parser_test.go b/lib/ssh/config_parser_test.go
index 27a46741..7e564f6e 100644
--- a/lib/ssh/config_parser_test.go
+++ b/lib/ssh/config_parser_test.go
@@ -18,7 +18,7 @@ func TestIsIncludeDirective(t *testing.T) {
}{{
line: "",
}, {
- line: "includ", //nolint: misspell
+ line: "includ",
}, {
line: "INCLUDE",
}, {
diff --git a/lib/ssh/ssh_test.go b/lib/ssh/ssh_test.go
index 1f84db0b..33ddfe66 100644
--- a/lib/ssh/ssh_test.go
+++ b/lib/ssh/ssh_test.go
@@ -12,7 +12,6 @@ import (
"github.com/shuLhan/share/lib/test"
)
-//nolint: gochecknoglobals
var (
testDefaultSection = newConfigSection()
testParser *configParser