go
已收录文章:1000篇
-
问题内容 func test_gomaxprocs() { runtime.GOMAXPROCS(1) wg := sync.WaitGroup{} wg.Add(20) for i := 0; i < 10; i++ { go func() { fmt.Println("i:", i) defer wg.Done() }() } for i := 0;489 收藏
-
问题内容 我用的github.com/go-sql-driver/mysql这个驱动,我像下面这样写没有报错,但是里面的数据为空或者0 type data struct { id int name string weight int } rows, _ := db.Query("select * from test where id = ?",489 收藏
-
最近在解析 // model.LocalTime package model const TimeFormat = "2006-01-02 15:04:05" type LocalTime time.Time 业务代码结构 // You Application Struct package order type OrderTest struct { OrderId int `json:"order_id"`489 收藏
-
问题内容我在学习Reader的时候,发现有io.Reader和strings.Reader:io.Reader: type Reader interface { Read(p []byte) (n int, err error) } strings.Reader: type Reader struct { s string i int64 // current readin488 收藏
-
问题内容 设置cookie之后,浏览器调试在Application中没有cookie信息,页面刷新之后cookie消失了,程序也获取不到,不知道哪里出现了问题,设置cookie时有什么需要注意的吗?下图是请求和返回信息 下图是A488 收藏
-
问题内容 package main import ( "database/sql" "github.com/ant0ine/go-json-rest/rest" _ "github.com/lib/pq" "log" "net/http" ) func main() { api := rest.NewApi() api.Use(rest.DefaultDevStack...) router, err := rest.Ma488 收藏
-
Go 1.21 之后,工具链版本不只由机器上的 go 决定。用 go.mod、GOTOOLCHAIN 和 CI 矩阵配合,能把自动升级、固定版本和失败回退边界讲清楚。488 收藏
-
问题内容看了下gorm基础,有以下疑问:定义如下Modeltype Model struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }请问 形如 gorm:"primaryKey"487 收藏
-
问题内容环境 github.com/micro/micro/v3如图所示 我没有helloworld-srv这个文件 这个文件哪来的?这是用micro new生成的正确答案看着意思很明显是,把应用编译成了 helloworld-srv 这个名字啊。然后复制进487 收藏
-
问题内容最近要完成一个html解析的工作,请问一下go语言下有类似jsoup的库吗正确答案 不知道你的jsoup指的是什么,不过go有个类似jquery专门用于dom解析的库。 https://github.com/PuerkitoBi...487 收藏
-
问题内容 1.nsq 主要的二个文章。http://www.infoq.com/cn/news/2015/02/nsq... http://wiki.jikexueyuan.com/project/nsq-...。我想问,这个东西做什么用,主要用在什么地方。以前是app开发,不是很了解什么叫消息系487 收藏
-
问题内容Revel框架怎么介入beego的ORM? 正确答案import( "github.com/astaxie/beego/orm" ) 然后就声明 struct 直接用了。487 收藏