diff --git a/example/client.go b/example/client.go index 4ff66e8..a7f7fbe 100644 --- a/example/client.go +++ b/example/client.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/lim-yoona/msgpack" + "github.com/lim-yoona/tcpack" "net" ) @@ -16,7 +16,7 @@ func main() { if err != nil { fmt.Println("create tcpconn failed", err) } - mp := msgpack.NewMsgPack(8, tcpConn) + mp := tcpack.NewMsgPack(8, tcpConn) go func() { for { msg, err := mp.Unpack() @@ -32,7 +32,7 @@ func main() { for { var data string fmt.Scanln(&data) - msg := msgpack.NewMessage(0, uint32(len([]byte(data))), []byte(data)) + msg := tcpack.NewMessage(0, uint32(len([]byte(data))), []byte(data)) msgByte, err := mp.Pack(msg) if err != nil { fmt.Println("msg pack failed:", err) diff --git a/example/server.go b/example/server.go index 533e403..9c2ea89 100644 --- a/example/server.go +++ b/example/server.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/lim-yoona/msgpack" + "github.com/lim-yoona/tcpack" "net" "time" ) @@ -22,7 +22,7 @@ func main() { if err != nil { fmt.Println("return conn failed") } - mp := msgpack.NewMsgPack(8, tcpConn) + mp := tcpack.NewMsgPack(8, tcpConn) go func() { for { msg, err := mp.Unpack() @@ -39,7 +39,7 @@ func main() { for { var data string fmt.Scanln(&data) - msg := msgpack.NewMessage(0, uint32(len([]byte(data))), []byte(data)) + msg := tcpack.NewMessage(0, uint32(len([]byte(data))), []byte(data)) msgByte, err := mp.Pack(msg) if err != nil { fmt.Println("msg pack failed:", err) diff --git a/example/transmitJSON.go b/example/transmitJSON.go index ba41487..13cb8dd 100644 --- a/example/transmitJSON.go +++ b/example/transmitJSON.go @@ -3,7 +3,7 @@ package main import ( "encoding/json" "fmt" - "github.com/lim-yoona/msgpack" + "github.com/lim-yoona/tcpack" "net" ) @@ -19,12 +19,12 @@ func main() { //server listener, _ := net.ListenTCP("tcp4", address2) - msgChan := make(chan *msgpack.Imessage, 10) + msgChan := make(chan *tcpack.Imessage, 10) go func() { for { tcpConnServer, _ := listener.AcceptTCP() - mpServer := msgpack.NewMsgPack(8, tcpConnServer) + mpServer := tcpack.NewMsgPack(8, tcpConnServer) for { msgRev, _ := mpServer.Unpack() msgChan <- &msgRev @@ -38,7 +38,7 @@ func main() { fmt.Println("create tcpConn failed") } - mpClient := msgpack.NewMsgPack(8, tcpConnClient) + mpClient := tcpack.NewMsgPack(8, tcpConnClient) jack := &Person{ Name: "jack", @@ -46,7 +46,7 @@ func main() { } data, _ := json.Marshal(jack) fmt.Println("send JSON:", string(data)) - msgSend := msgpack.NewMessage(0, uint32(len(data)), data) + msgSend := tcpack.NewMessage(0, uint32(len(data)), data) msgSendByte, _ := mpClient.Pack(msgSend) _, _ = tcpConnClient.Write(msgSendByte) diff --git a/go.mod b/go.mod index 57af57e..8d4d9f8 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,7 @@ module github.com/lim-yoona/tcpack go 1.20 -require ( - github.com/lim-yoona/msgpack v0.1.0 - github.com/smartystreets/goconvey v1.8.1 -) +require github.com/smartystreets/goconvey v1.8.1 require ( github.com/gopherjs/gopherjs v1.17.2 // indirect diff --git a/go.sum b/go.sum index 14348cd..7fea79b 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25d github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/lim-yoona/msgpack v0.1.0 h1:sAULeEVw0RpF9iujzIFzAYntuE/dFd9v6yLqhWZKAPU= -github.com/lim-yoona/msgpack v0.1.0/go.mod h1:w/GynN0+bueeewRWfznv51+auiQuX1O/BSp41dAHFWk= github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY= github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY=