mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
Use go fmt before build
This commit is contained in:
parent
bdcdafd768
commit
fa9356936b
5
Makefile
5
Makefile
@ -2,12 +2,15 @@ export PATH := $(GOPATH)/bin:$(PATH)
|
|||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build: godep frps frpc
|
build: godep fmt frps frpc
|
||||||
|
|
||||||
godep:
|
godep:
|
||||||
@go get github.com/tools/godep
|
@go get github.com/tools/godep
|
||||||
godep restore
|
godep restore
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
@godep go fmt ./...
|
||||||
|
|
||||||
frps:
|
frps:
|
||||||
godep go build -o bin/frps ./cmd/frps
|
godep go build -o bin/frps ./cmd/frps
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ var (
|
|||||||
|
|
||||||
var ProxyClients map[string]*models.ProxyClient = make(map[string]*models.ProxyClient)
|
var ProxyClients map[string]*models.ProxyClient = make(map[string]*models.ProxyClient)
|
||||||
|
|
||||||
|
|
||||||
func LoadConf(confFile string) (err error) {
|
func LoadConf(confFile string) (err error) {
|
||||||
var tmpStr string
|
var tmpStr string
|
||||||
var ok bool
|
var ok bool
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"github.com/fatedier/frp/pkg/models"
|
"github.com/fatedier/frp/pkg/models"
|
||||||
"github.com/fatedier/frp/pkg/utils/conn"
|
"github.com/fatedier/frp/pkg/utils/conn"
|
||||||
|
@ -20,7 +20,6 @@ var (
|
|||||||
|
|
||||||
var ProxyServers map[string]*models.ProxyServer = make(map[string]*models.ProxyServer)
|
var ProxyServers map[string]*models.ProxyServer = make(map[string]*models.ProxyServer)
|
||||||
|
|
||||||
|
|
||||||
func LoadConf(confFile string) (err error) {
|
func LoadConf(confFile string) (err error) {
|
||||||
var tmpStr string
|
var tmpStr string
|
||||||
var ok bool
|
var ok bool
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"encoding/json"
|
"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/models"
|
||||||
|
"github.com/fatedier/frp/pkg/utils/conn"
|
||||||
|
"github.com/fatedier/frp/pkg/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ProcessControlConn(l *conn.Listener) {
|
func ProcessControlConn(l *conn.Listener) {
|
||||||
|
@ -3,8 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/fatedier/frp/pkg/utils/log"
|
|
||||||
"github.com/fatedier/frp/pkg/utils/conn"
|
"github.com/fatedier/frp/pkg/utils/conn"
|
||||||
|
"github.com/fatedier/frp/pkg/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -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) {
|
func (p *ProxyClient) GetRemoteConn(addr string, port int64) (c *conn.Conn, err error) {
|
||||||
c = &conn.Conn{}
|
c = &conn.Conn{}
|
||||||
defer func(){
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Close()
|
c.Close()
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ type ClientCtlRes struct {
|
|||||||
GeneralRes
|
GeneralRes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type ServerCtlReq struct {
|
type ServerCtlReq struct {
|
||||||
Type int64 `json:"type"`
|
Type int64 `json:"type"`
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync"
|
|
||||||
"container/list"
|
"container/list"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/fatedier/frp/pkg/utils/conn"
|
"github.com/fatedier/frp/pkg/utils/conn"
|
||||||
"github.com/fatedier/frp/pkg/utils/log"
|
"github.com/fatedier/frp/pkg/utils/log"
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package conn
|
package conn
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net"
|
|
||||||
"bufio"
|
"bufio"
|
||||||
"sync"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/fatedier/frp/pkg/utils/log"
|
"github.com/fatedier/frp/pkg/utils/log"
|
||||||
)
|
)
|
||||||
|
@ -22,7 +22,7 @@ func SetLogFile(logWay string, logFile string) {
|
|||||||
if logWay == "console" {
|
if logWay == "console" {
|
||||||
Log.SetLogger("console", "")
|
Log.SetLogger("console", "")
|
||||||
} else {
|
} else {
|
||||||
Log.SetLogger("file", `{"filename": "` + logFile + `"}`)
|
Log.SetLogger("file", `{"filename": "`+logFile+`"}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user