Stories
ListGo之原生RPC (基礎)
一, 服務器1 package main import ( "log" "net" "net/http" "net/rpc" ) type RpcServer struct { } type RpcRequest struct { NumO int Num1 int } type RpcResponse struct { Num int }
Go之簡單WebSocket (基礎)
一,情景 因為golang.org/x/net/websocket未被go團隊納入標準庫,go團隊也未推薦使用,且次庫還有一些問題,並且不再維護。 所以,推薦使用:github.com/gorilla/websocket 安裝命令: go get github.com/gorilla/websocket@latest 二, 服務端
Go之Gin框架(基礎)
文檔地址:https://www.kancloud.cn/shuangdeyu/gin_book/949411 一,請求類型 GET / POST package main import ( "github.com/gin-gonic/gin" "net/http" ) func main() { r := gin.Default() r.