This is a creation in Article, where the information may have evolved or changed.
Golang debugging is troublesome, debug stop into cannot jump to the code you write, but can jump to the system-provided code.
The following is a simple test code:
Package MainImport (
"FMT"
)
Func Main () {
I: = 5
Even (i)
B: = 1
Fmt. Printf ("is%d even?" %v\n ", I, B)
}
Func even (i int) bool {
A: = 1
B: = a + 1
b = B + 1
return i%2 = = 0
}
The situation is so bizarre that the Golang gdb is everywhere on the internet. See here for details:
Http://grokbase.com/t/gg/golang-nuts/1443r0vch8/go-nuts-debugging-in-go-seems-to-be-a-very-difficult-task-to-accomplish
But at the end of the liteide, someone provided a way to set it inside.
1-open your project in Liteide2-select "Build" menu and under it select "Build Configuration ..." 3-a dialog shows up. Select "Custom" tab. It contains a list of key/valuepairs4-double click the space reserved for the value of "Buildargs" 5-write-gcflags "-N -L "6-close the dialog by clicking Ok button7-rebuild your project (ctrl+b) 8-press F5 to start debugging9-put some Breakpoints wherever wish10-press F5 again to reach the first breakpoint
Solution:
1-Open Liteide Build Settings 2-Modify Buildargs variable, add parameter-gcflags "-n-l" Note there is a quotation mark 3-Save it now 4-enjoy it