我想使用只向对象返回一行的go-pg进行queryOne,而不是数组。这是我的简单代码: var reportMessage *ReportMessage
_, err := db.Model((*ReportMessage)(nil)).QueryOne(&reportMessage这是我的错误: json: cannot unmarshal number into Go value of type models.ReportMessage 如何只查询一行并将其返回给object而不是
我需要在两个不同的步骤,但到目前为止,我还没有找到这样做的方法。第二,我需要连接字符串,总共将有6个字符串变量需要连接,我只找到了只接受2个参数的strcat函数。这些是我正在尝试构建的字符串:
char *queryOne = "INSERT INTO location (id, carid, ownerid, lat, long, speed) V