This commit is contained in:
Feng_Qi 2018-07-03 13:55:49 +08:00
parent de1b1f2b59
commit e704825aa9
5 changed files with 14 additions and 7 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
*.txt
*.json
*.exe
*.key
*.key
*.zip

View file

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [2017] [shanghai-edu]
Copyright [2017] [shanghai-edu & ECNU]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View file

@ -3,7 +3,7 @@ package funcs
import (
"bytes"
// "os"
//"strings"
"strings"
"testing"
)
@ -16,7 +16,6 @@ const (
key = "../server.key"
)
/*
func Test_SSH(t *testing.T) {
var cipherList []string
session, err := connect(username, password, ip, key, port, cipherList)
@ -51,8 +50,8 @@ func Test_SSH(t *testing.T) {
t.Log((outbt.String() + errbt.String()))
return
}
*/
/*
func Test_SSH_run(t *testing.T) {
var cipherList []string
session, err := connect(username, password, ip, key, port, cipherList)
@ -77,3 +76,4 @@ func Test_SSH_run(t *testing.T) {
return
}
*/

View file

@ -80,7 +80,11 @@ func GetJsonFile(filePath string) ([]SSHHost, error) {
return result, err
}
var m HostJson
json.Unmarshal(b, &m)
err = json.Unmarshal(b, &m)
if err != nil {
log.Println("read file ", filePath, err)
return result, err
}
result = m.SshHosts
return result, nil
}

View file

@ -6,6 +6,8 @@ package g
// 0.2
// 0.2.1
// add write locate file
// json Unmarshal with error
// 0.2.3
const (
VERSION = "0.2.2"
VERSION = "0.2.3"
)