From 8f8d762742baa2f8e82012f9bb8790dc0e9be480 Mon Sep 17 00:00:00 2001 From: xtaci Date: Thu, 28 Jun 2018 19:25:37 +0800 Subject: [PATCH] gofmt --- client/main.go | 11 +++++------ server/main.go | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/client/main.go b/client/main.go index 991f05a..7966f26 100644 --- a/client/main.go +++ b/client/main.go @@ -19,7 +19,7 @@ import ( kcp "github.com/xtaci/kcp-go" "github.com/xtaci/smux" - "path/filepath" + "path/filepath" ) var ( @@ -478,11 +478,10 @@ func snmpLogger(path string, interval int) { for { select { case <-ticker.C: - // TODO : Please review - // split path into dirname and filename - logdir, logfile := filepath.Split(path) - // only format logfile - f, err := os.OpenFile(logdir + time.Now().Format(logfile), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + // split path into dirname and filename + logdir, logfile := filepath.Split(path) + // only format logfile + f, err := os.OpenFile(logdir+time.Now().Format(logfile), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { log.Println(err) return diff --git a/server/main.go b/server/main.go index 48a591d..a90e0e3 100644 --- a/server/main.go +++ b/server/main.go @@ -15,12 +15,12 @@ import ( "golang.org/x/crypto/pbkdf2" + "path/filepath" + "github.com/golang/snappy" "github.com/urfave/cli" kcp "github.com/xtaci/kcp-go" "github.com/xtaci/smux" - "path/filepath" - ) var ( @@ -402,11 +402,10 @@ func snmpLogger(path string, interval int) { for { select { case <-ticker.C: - // TODO: Please review - // split path into dirname and filename - logdir, logfile := filepath.Split(path) - // only format logfile - f, err := os.OpenFile(logdir + time.Now().Format(logfile), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + // split path into dirname and filename + logdir, logfile := filepath.Split(path) + // only format logfile + f, err := os.OpenFile(logdir+time.Now().Format(logfile), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { log.Println(err) return