2025年5月31日

go 基于beego+swagger生成支持直接调用的接口文档

摘要: 安装工具 go get github.com/astaxie/beego go get github.com/beego/bee 创建API项目 # 必须在GOPATH下创建项目,否则无法在routers目录下生成commentsRouter_controllers.go,访问URL会报错404 c 阅读全文

posted @ 2025-05-31 23:04 王景迁 阅读(19) 评论(0) 推荐(0)

go 单元测试使用assert

摘要: package test import ( "testing" "github.com/stretchr/testify/assert" ) func TestSomething(t *testing.T) { a := "a" b := "b" // a是expected // b是actual 阅读全文

posted @ 2025-05-31 20:21 王景迁 阅读(22) 评论(0) 推荐(0)

导航