Skip to content

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jun 28, 2018
1 parent e3ab00c commit 8f8d762
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
11 changes: 5 additions & 6 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
kcp "github.com/xtaci/kcp-go"
"github.com/xtaci/smux"

"path/filepath"
"path/filepath"
)

var (
Expand Down Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8f8d762

Please sign in to comment.