14 Star 58 Fork 24

Gitee 极速下载 / Pingtunnel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/esrrhs/pingtunnel
克隆/下载
pingtunnel_test.go 445 Bytes
一键复制 编辑 原始数据 按行查看 历史
shitfuck 提交于 2023-11-29 09:39 . Revert "delete"
package pingtunnel
import (
"fmt"
"github.com/golang/protobuf/proto"
"testing"
)
func Test0001(t *testing.T) {
my := &MyMsg{}
my.Id = "12345"
my.Target = "111:11"
my.Type = 12
my.Data = make([]byte, 0)
dst, _ := proto.Marshal(my)
fmt.Println("dst = ", dst)
my1 := &MyMsg{}
proto.Unmarshal(dst, my1)
fmt.Println("my1 = ", my1)
fmt.Println("my1.Data = ", my1.Data)
proto.Unmarshal(dst[0:4], my1)
fmt.Println("my1 = ", my1)
}
1
https://gitee.com/mirrors/Pingtunnel.git
git@gitee.com:mirrors/Pingtunnel.git
mirrors
Pingtunnel
Pingtunnel
master

搜索帮助