When using the default configuration generated by air init to debug programs with air -d, the air console cannot display the error location information. However, when debugging with the Goland IDE, the error location information can be displayed.
for example:
Goland log:
[GIN-debug] POST /api/upload --> app/models.attachmentUpload (4 handlers)
[GIN-debug] GET /file/:file --> app/models.attachmentGet (4 handlers)
panic: template: detail.html:103: function "escape" not defined -------------------------------------here is the error location
goroutine 1 [running]:
html/template.Must(0x0, {0x7ff76aa6ffe0, 0xc000255f40})
C:/go/src/html/template/template.go:368 +0x86
github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob(0xc000093d40, {0x7ff76a9d5d1b, 0x1e})
D:/repo/go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/gin.go:265 +0x145
app/routes.Init(0xc000093d40)
C:/Users/CFA/Desktop/app/routes/routes.go:25 +0x114
main.main()
C:/Users/CFA/Desktop/app/main.go:14 +0xaf
air log:
[GIN-debug] POST /api/upload --> app/models.attachmentUpload (4 handlers)
[GIN-debug] GET /file/:file --> app/models.attachmentGet (4 handlers)
** execution is paused because your program is panicking **
To continue the execution please connect your client to the debugger.
Stack trace:
0 0x00007ff63dc57904 in runtime.fatalpanic
at C:/go/src/runtime/panic.go:1301
1 0x00007ff63dc8ac0f in runtime.gopanic
at C:/go/src/runtime/panic.go:811
2 0x00007ff63e3b8746 in html/template.Must
at C:/go/src/html/template/template.go:368
3 0x00007ff63ea19c65 in github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob
at D:/repo/go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/gin.go:265
4 0x00007ff63ea3aff4 in app/routes.Init
at C:/Users/CFA/Desktop/app/routes/routes.go:25
5 0x00007ff63ea3b0ef in main.main
at C:/Users/CFA/Desktop/app/main.go:14
6 0x00007ff63dc5a667 in runtime.main
at C:/go/src/runtime/proc.go:283
7 0x00007ff63dc92b41 in runtime.goexit
at C:/go/src/runtime/asm_amd64.s:1700
When using the default configuration generated by
air initto debug programs withair -d, the air console cannot display the error location information. However, when debugging with the Goland IDE, the error location information can be displayed.for example:
Goland log:
air log: