style: fmt

This commit is contained in:
exfly
2019-08-10 11:15:25 +08:00
parent 5fcbeb60aa
commit b0d16d3b3d
43 changed files with 182 additions and 141 deletions

View File

@@ -2,11 +2,12 @@ package mux
import (
"errors"
"github.com/cnlh/nps/lib/pool"
"io"
"net"
"sync"
"time"
"github.com/cnlh/nps/lib/pool"
)
type conn struct {

View File

@@ -4,12 +4,13 @@ import (
"bytes"
"encoding/binary"
"errors"
"github.com/cnlh/nps/lib/pool"
"math"
"net"
"sync"
"sync/atomic"
"time"
"github.com/cnlh/nps/lib/pool"
)
const (
@@ -174,7 +175,7 @@ func (s *Mux) readSession() {
case conn.getStatusCh <- struct{}{}:
default:
}
conn.hasWrite --
conn.hasWrite--
case MUX_NEW_CONN_OK: //conn ok
conn.connStatusOkCh <- struct{}{}
case MUX_NEW_CONN_Fail:

View File

@@ -1,15 +1,16 @@
package mux
import (
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/pool"
"github.com/astaxie/beego/logs"
"log"
"net"
"net/http"
_ "net/http/pprof"
"testing"
"time"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/pool"
)
var conn1 net.Conn

View File

@@ -5,15 +5,16 @@ package mux
import (
"bufio"
"bytes"
"github.com/cnlh/nps/lib/common"
"github.com/astaxie/beego/logs"
"github.com/pkg/errors"
"io"
"net"
"os"
"strconv"
"strings"
"time"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/common"
"github.com/pkg/errors"
)
const (

View File

@@ -1,9 +1,10 @@
package mux
import (
"github.com/astaxie/beego/logs"
"testing"
"time"
"github.com/astaxie/beego/logs"
)
func TestPortMux_Close(t *testing.T) {
@@ -11,7 +12,7 @@ func TestPortMux_Close(t *testing.T) {
logs.EnableFuncCallDepth(true)
logs.SetLogFuncCallDepth(3)
pMux := NewPortMux(8888,"Ds")
pMux := NewPortMux(8888, "Ds")
go func() {
if pMux.Start() != nil {
logs.Warn("Error")

View File

@@ -2,8 +2,9 @@ package mux
import (
"errors"
"github.com/cnlh/nps/lib/pool"
"sync"
"github.com/cnlh/nps/lib/pool"
)
type Element *bufNode