英文: gorp Update not updating 问题 我在使用gorp更新postgresql数据库中的一行时遇到了问题。我能够成功地使用db.Exec运行更新操作,所有列都会更新为正确的信...
使用golang发送带有字符串数据的POST请求。
英文: POST golang request with string data 问题 我可以使用POSTMAN Chrome扩展程序进行字符串数据的POST请求。 我需要使用golang代码完成相同...
How to set Golang's log output back to console?
英文: How to set Golang's log output back to console? 问题 Google Go的log包有一个名为SetOutput的函数,用于将日志输出设置...
如何检查路径上的目录是否为空?
英文: How to check if directory on path is empty? 问题 在Go语言中,如何检查文件夹是否为空?可以像这样进行检查: files, err := iouti...
使用反射设置字段的方法是通过 reflect.Set。
英文: Setting field using reflect.Set 问题 我已经翻译了你的代码,如下所示: var t reflect.Type = LaunchController(route....
为什么使用数组而不是切片?
英文: Why use arrays instead of slices? 问题 我一直在研究Go语言,并且在思考这个基本问题时遇到了困惑。 在Go语言中,很明显切片更加灵活,通常可以在需要数据序列时...
How to read specific line of file?
英文: How to read specific line of file? 问题 我需要读取文件的特定行。我已经阅读了一些相关的主题:https://stackoverflow.com/questi...
Golang – 如何使单个结构体与多个结构体一起工作?
英文: Golang - How to make single struct works together with multiple structs? 问题 我想让单个结构与多个结构一起工作。 在下...
确定POST数据值是否与结构字段类型匹配
英文: Determine if POST data value matches struct field type 问题 使用gin框架,我正在尝试确定POST的数据是否与结构字段类型不匹配,并通知...
在Go语言中进行光标键终端输入
英文: Cursor key terminal input in Go 问题 我正在为终端创建一个Go应用程序。以下代码要求用户在终端输入文本。 package main import ( "...
32