format代码

This commit is contained in:
Hurricanezwf 2016-02-05 16:49:52 +08:00
parent 04c26d1c31
commit 60c9804776
7 changed files with 19 additions and 18 deletions

1
.gitignore vendored
View File

@ -28,3 +28,4 @@ bin/
# Cache
*.swp
*.swo

View File

@ -3,8 +3,8 @@ package main
import (
"os"
"frp/pkg/utils/log"
"frp/pkg/utils/conn"
"frp/pkg/utils/log"
)
func main() {

View File

@ -24,7 +24,7 @@ func (p *ProxyClient) GetLocalConn() (c *conn.Conn, err error) {
func (p *ProxyClient) GetRemoteConn(addr string, port int64) (c *conn.Conn, err error) {
c = &conn.Conn{}
defer func(){
defer func() {
if err != nil {
c.Close()
}

View File

@ -21,7 +21,6 @@ type ClientCtlRes struct {
GeneralRes
}
type ServerCtlReq struct {
Type int64 `json:"type"`
}

View File

@ -89,6 +89,7 @@ func (p *ProxyServer) Start() (err error) {
p.UserConnList.Remove(element)
} else {
cliConn.Close()
p.Unlock()
continue
}
p.Unlock()

View File

@ -22,7 +22,7 @@ func SetLogFile(logWay string, logFile string) {
if logWay == "console" {
Log.SetLogger("console", "")
} else {
Log.SetLogger("file", `{"filename": "` + logFile + `"}`)
Log.SetLogger("file", `{"filename": "`+logFile+`"}`)
}
}