会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
管理
上一页
1
2
3
4
5
6
7
···
14
下一页
2021年5月3日
protobuf的使用
摘要: 先上官方使用文档 https://developers.google.cn/protocol-buffers/docs/proto3 定义proto文件 syntax = "proto3"; //.表示生成的go文件存放到当前目录下 student表示文件的包名为student option go_
阅读全文
posted @ 2021-05-03 11:18 GPHPER
阅读(399)
评论(0)
推荐(0)
2021年5月2日
protobuf windows环境安装
摘要: protocol buffers 是一种语言无关、平台无关、可扩展的序列化结构数据的方法,它可用于(数据)通信协议、数据存储等。总之微服务中需要使用的东西 安装protobuf 下载protobuf https://github.com/protocolbuffers/protobuf/releas
阅读全文
posted @ 2021-05-02 12:45 GPHPER
阅读(2633)
评论(0)
推荐(1)
2021年5月1日
使用net/rpc构建微服务
摘要: 使用rpc启动一个订单中心服务 package mainimport ( "net" "net/http" "net/rpc" "time")type OrderCenter struct {}//暴露的方法必须符合 func (t *T) MethodName(argType T1, replyT
阅读全文
posted @ 2021-05-01 14:21 GPHPER
阅读(164)
评论(0)
推荐(0)
2021年4月26日
golang——image库图片上写字
摘要: package main import ( "github.com/golang/freetype" "image" "image/color" "image/png" "io/ioutil" "log" "os" ) func main() { //图片的宽度 srcWidth := 200 //
阅读全文
posted @ 2021-04-26 13:04 GPHPER
阅读(724)
评论(0)
推荐(0)
2021年4月25日
golang标准库——image
摘要: 使用golang标准库中的 image 库合成图片 package main import ( "fmt" "image" "image/draw" _ "image/jpeg" "image/png" "os" ) func main() { file,err := os.Open("./publ
阅读全文
posted @ 2021-04-25 21:19 GPHPER
阅读(382)
评论(0)
推荐(0)
2021年4月24日
GinAdmin——基于golang的web管理平台
摘要: GinAdmin 这个项目是以Gin框架为基础搭建的后台管理平台,虽然很多人都认为go是用来开发高性能服务端项目的,但是也难免有要做web管理端的需求,总不能再使用别的语言来开发吧。所以整合出了GinAdmin项目,请大家多提意见指正! GitHub地址 https://github.com/gph
阅读全文
posted @ 2021-04-24 11:21 GPHPER
阅读(1338)
评论(0)
推荐(0)
2021年3月6日
golang学习笔记——context库
摘要: WithCancel(主进程控制子协程关闭) package main import ( "context" "fmt" "sync" "time" ) var wg sync.WaitGroup func f(ctx context.Context) { defer wg.Done() LOOP:
阅读全文
posted @ 2021-03-06 11:59 GPHPER
阅读(163)
评论(0)
推荐(0)
2021年3月5日
golang学习笔记——sync库
摘要: sync.WaitGroup 优雅的同步执行协程 package main import ( "fmt" "math/rand" "sync" "time" ) func f1(i int) { defer wg.Done() rand.Seed(time.Now().UnixNano()) tim
阅读全文
posted @ 2021-03-05 21:24 GPHPER
阅读(159)
评论(0)
推荐(0)
golang学习笔记——select
摘要: select就是用来监听和channel有关的IO操作,当 IO 操作发生时,触发相应的动作 package main import ( "fmt" "time" ) func main() { ch := make(chan int) o := make(chan bool) go func()
阅读全文
posted @ 2021-03-05 20:57 GPHPER
阅读(78)
评论(0)
推荐(0)
2021年3月3日
golang学习笔记——定时器
摘要: Timer定时器 启动 package main import ( "fmt" "time" ) func main() { <-time.After(2 * time.Second) fmt.Println("延时两秒") } func main02() { time.Sleep(2 * time
阅读全文
posted @ 2021-03-03 21:15 GPHPER
阅读(109)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
14
下一页
公告
TOP