草庐IT

GIN-debug

全部标签

go - 获取/文章/:article_id Not working Gin-Gonic/Gin

我正在使用API,GET和POST工作正常,除非我尝试通过其ID获取选择记录(例如/articles/2)。文章存在,当通过/articles路径检索所有记录时,我得到了正确的响应。这是堆栈跟踪。$gorunmain.go[GIN-debug][WARNING]Runningin"debug"mode.Switchto"release"modeinproduction.-usingenv:exportGIN_MODE=release-usingcode:gin.SetMode(gin.ReleaseMode)[GIN-debug]GET/-->main.index(3handlers)

debugging - VSCode 调试 golang。深入调试器

我在使用VisualStudioCode中的Delve调试器时遇到问题。调试开始但没有任何反应。控制台中只有信息:time="2018-06-23T16:35:55+02:00"level=infomsg="launchingprocesswithargs:[C:\\Users\\LenovoPC\\go\\src\\test\\debug]"layer=debuggerlaunch.json的配置"version":"0.2.0","configurations":[{"name":"Launch","type":"go","request":"launch","mode":"deb

debugging - VSCode 调试 golang。深入调试器

我在使用VisualStudioCode中的Delve调试器时遇到问题。调试开始但没有任何反应。控制台中只有信息:time="2018-06-23T16:35:55+02:00"level=infomsg="launchingprocesswithargs:[C:\\Users\\LenovoPC\\go\\src\\test\\debug]"layer=debuggerlaunch.json的配置"version":"0.2.0","configurations":[{"name":"Launch","type":"go","request":"launch","mode":"deb

debugging - GDB无法调试cgo代码内的go程序

示例文件src/test.gopackagemainimport(."clib")funcmain(){a:="123";b:="456";c:="789";println(a,b,c);Output("ABC");}src/clib/clib.h#ifndefCLIBvoidoutput(char*str);#endifsrc/clib/clib.c#include"clib.h"#includevoidoutput(char*str){printf("%s\n",str);}src/clib/clib.gopackageclib/*#cgoCFLAGS:-g#include"cli

debugging - GDB无法调试cgo代码内的go程序

示例文件src/test.gopackagemainimport(."clib")funcmain(){a:="123";b:="456";c:="789";println(a,b,c);Output("ABC");}src/clib/clib.h#ifndefCLIBvoidoutput(char*str);#endifsrc/clib/clib.c#include"clib.h"#includevoidoutput(char*str){printf("%s\n",str);}src/clib/clib.gopackageclib/*#cgoCFLAGS:-g#include"cli

debugging - 调试golang程序时如何检查GoLand中的全局变量?

在GoLand中调试go程序时,看不到全局变量的值。谁能告诉我为什么以及如何解决它?这是一个例子:我在main函数的最后一行设置了一个断点。但是如图所示,我们只能得到'a'的值,而不能得到'a'和'xx'。packagemainimport"fmt"varxxint=1funcmain(){varaint=1fmt.Println(a)xx=3fmt.Println("end")} 最佳答案 我们可以使用Evaluate函数获取全局变量的值,但是每次只能获取一个值 关于debugging

debugging - 调试golang程序时如何检查GoLand中的全局变量?

在GoLand中调试go程序时,看不到全局变量的值。谁能告诉我为什么以及如何解决它?这是一个例子:我在main函数的最后一行设置了一个断点。但是如图所示,我们只能得到'a'的值,而不能得到'a'和'xx'。packagemainimport"fmt"varxxint=1funcmain(){varaint=1fmt.Println(a)xx=3fmt.Println("end")} 最佳答案 我们可以使用Evaluate函数获取全局变量的值,但是每次只能获取一个值 关于debugging

html - Gin : Loading html files with stylesheet

我的英语很基础,对不起:)好吧,我的问题是当Gin加载HTML时,我的HTML文件包含导入(/stylesheet/index.css),所以当我用Gin运行我的应用程序时,这个警告没有加载样式表文件workspace/main/main.gotemplates/index.tmpl.htmlcss/index.css主.gor.LoadHTMLFiles("../templates/index.tmpl.html")r.GET("/index",func(c*gin.Context){c.HTML(200,"index.tmpl.html",gin.H{"title":"Mainwe

html - Gin : Loading html files with stylesheet

我的英语很基础,对不起:)好吧,我的问题是当Gin加载HTML时,我的HTML文件包含导入(/stylesheet/index.css),所以当我用Gin运行我的应用程序时,这个警告没有加载样式表文件workspace/main/main.gotemplates/index.tmpl.htmlcss/index.css主.gor.LoadHTMLFiles("../templates/index.tmpl.html")r.GET("/index",func(c*gin.Context){c.HTML(200,"index.tmpl.html",gin.H{"title":"Mainwe

go - 如何使模板与 gin 框架一起工作?

我是golang的新手。为了学习它,我开始使用一个简单的网络应用程序gin框架。我遵循了gindoc和配置的模板文件,但无法使其工作。我收到一个错误-panic:html/template:patternmatchesnofiles:`templates/*`goroutine1[running]:html/template.Must/usr/local/Cellar/go/1.5.2/libexec/src/html/template/template.go:330github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob/Users/ameypa