Use go fmt before build

This commit is contained in:
fatedier 2016-02-03 18:46:24 +08:00
parent bdcdafd768
commit fa9356936b
12 changed files with 66 additions and 66 deletions

View File

@ -2,12 +2,15 @@ export PATH := $(GOPATH)/bin:$(PATH)
all: build
build: godep frps frpc
build: godep fmt frps frpc
godep:
@go get github.com/tools/godep
godep restore
fmt:
@godep go fmt ./...
frps:
godep go build -o bin/frps ./cmd/frps

View File

@ -20,7 +20,6 @@ var (
var ProxyClients map[string]*models.ProxyClient = make(map[string]*models.ProxyClient)
func LoadConf(confFile string) (err error) {
var tmpStr string
var ok bool

View File

@ -1,9 +1,9 @@
package main
import (
"encoding/json"
"io"
"sync"
"encoding/json"
"github.com/fatedier/frp/pkg/models"
"github.com/fatedier/frp/pkg/utils/conn"

View File

@ -20,7 +20,6 @@ var (
var ProxyServers map[string]*models.ProxyServer = make(map[string]*models.ProxyServer)
func LoadConf(confFile string) (err error) {
var tmpStr string
var ok bool

View File

@ -1,12 +1,12 @@
package main
import (
"fmt"
"encoding/json"
"fmt"
"github.com/fatedier/frp/pkg/utils/log"
"github.com/fatedier/frp/pkg/utils/conn"
"github.com/fatedier/frp/pkg/models"
"github.com/fatedier/frp/pkg/utils/conn"
"github.com/fatedier/frp/pkg/utils/log"
)
func ProcessControlConn(l *conn.Listener) {

View File

@ -3,8 +3,8 @@ package main
import (
"os"
"github.com/fatedier/frp/pkg/utils/log"
"github.com/fatedier/frp/pkg/utils/conn"
"github.com/fatedier/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

@ -1,8 +1,8 @@
package models
import (
"sync"
"container/list"
"sync"
"github.com/fatedier/frp/pkg/utils/conn"
"github.com/fatedier/frp/pkg/utils/log"

View File

@ -1,11 +1,11 @@
package conn
import (
"fmt"
"net"
"bufio"
"sync"
"fmt"
"io"
"net"
"sync"
"github.com/fatedier/frp/pkg/utils/log"
)

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+`"}`)
}
}