tarsgo uses go mode development under goland

A small example of tarsgo official download:

https://github.com/TarsCloud/TarsGo

Use goland to open a small example, the general structure is shown below:

Step 1: Open go modules and set up Proxy

Step 2: Initialize go mod

go mod init test


Step 3: Install TarsGo

go get github.com/TarsCloud/TarsGo/tars


Step 4: Compile tars protocol to Golang tool

go install github.com/TarsCloud/TarsGo/tars/tools/tars2go

Step 5: Compile the tars file and convert it to go

#有两个tars文件,所以都要转换一下
tars2go --outdir=./vendor EchoClient.tars
tars2go --outdir=./vendor EchoTest.tars

Step 6: As a server, reference and implement EchoTest.tars

Guess you like

Origin www.cnblogs.com/cnlihao/p/12751066.html