From e704825aa95b73ec43688a4aacc96e9166113057 Mon Sep 17 00:00:00 2001 From: Feng_Qi Date: Tue, 3 Jul 2018 13:55:49 +0800 Subject: [PATCH] 0.2.3 --- .gitignore | 3 ++- LICENSE | 2 +- funcs/ssh_test.go | 6 +++--- g/cfg.go | 6 +++++- g/const.go | 4 +++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 98e9d73..e722b28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.txt *.json *.exe -*.key \ No newline at end of file +*.key +*.zip \ No newline at end of file diff --git a/LICENSE b/LICENSE index e8e87ec..535a350 100644 --- a/LICENSE +++ b/LICENSE @@ -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. diff --git a/funcs/ssh_test.go b/funcs/ssh_test.go index a868590..0ff1d7e 100644 --- a/funcs/ssh_test.go +++ b/funcs/ssh_test.go @@ -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 } +*/ diff --git a/g/cfg.go b/g/cfg.go index 815cb8a..b3a3a32 100644 --- a/g/cfg.go +++ b/g/cfg.go @@ -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 } diff --git a/g/const.go b/g/const.go index 6f88939..f4256f1 100644 --- a/g/const.go +++ b/g/const.go @@ -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" )