File tree Expand file tree Collapse file tree 1 file changed +42
-3
lines changed Expand file tree Collapse file tree 1 file changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,53 @@ Open. From terminal:
52
52
$ goland
53
53
```
54
54
55
- ### Project Level Preferences
56
-
57
- Create a new project (new folder or existing)
55
+ Create a new project (new folder or existing):
58
56
59
57
Preferences (or wrench bottom right). Set GOPATH for project and uncheck from env. This means you can launch from anywhere
60
58
61
59
![ pathprefs] ( res/goland-gopath.png )
62
60
61
+ ## Debugging with Delve
62
+
63
+ [ Delve from the cmdline] ( https://lincolnloop.com/blog/debugging-go-code/ )
64
+
65
+ ``` bash
66
+ [dev] ~ /Study/go/src/helloworld$ dlv debug main.go -- arg1
67
+ Type ' help' for list of commands.
68
+ (dlv) break main.go:9
69
+ Breakpoint 1 set at 0x10ae9e4 for main.main () ./main.go:9
70
+ (dlv) break main.go:10
71
+ Breakpoint 2 set at 0x10aeaa0 for main.main () ./main.go:10
72
+ (dlv) continue
73
+ > main.main () ./main.go:9 (hits goroutine(1):1 total:1) (PC: 0x10ae9e4)
74
+ 4: " fmt"
75
+ 5: )
76
+ 6:
77
+ 7: func main () {
78
+ 8: msg := " Hellow World!"
79
+ => 9: fmt.Println(msg)
80
+ 10: fmt.Println(" " )
81
+ 11: }
82
+ (dlv) print msg
83
+ " Hellow World!"
84
+ (dlv) continue
85
+ Hellow World!
86
+ > main.main () ./main.go:10 (hits goroutine(1):1 total:1) (PC: 0x10aeaa0)
87
+ 5: )
88
+ 6:
89
+ 7: func main () {
90
+ 8: msg := " Hellow World!"
91
+ 9: fmt.Println(msg)
92
+ => 10: fmt.Println(" " )
93
+ 11: }
94
+ (dlv) continue
95
+
96
+ Process 6739 has exited with status 0
97
+ (dlv) exit
98
+ Process 6739 has exited with status 0
99
+ [dev] ~ /Study/go/src/helloworld$
100
+ ` ` `
101
+
63
102
# ## Debugging Stdin Issues
64
103
65
104
Version 2018.2 (use this):
You can’t perform that action at this time.
0 commit comments