This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (dlv) r | |
| Process restarted with PID 6078 | |
| (dlv) b main.go:12 | |
| Breakpoint 2 set at 0x6fcbb4 for main.main() ./main.go:12 | |
| (dlv) clear 1 | |
| Breakpoint 1 cleared at 0x6fcb78 for main.main() ./main.go:10 | |
| (dlv) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (dlv) | |
| > main.main() ./main.go:12 (PC: 0x6fcbb4) | |
| 7: "fmt" | |
| 8: ) | |
| 9: | |
| 10: func main() { | |
| 11: http.HandleFunc("/", webserver) | |
| => 12: http.ListenAndServe(":8080", nil) | |
| 13: message := get() | |
| 14: fmt.Println("The webserver said:", message) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (dlv) next | |
| > main.main() ./main.go:11 (PC: 0x6fcb8f) | |
| 6: "io/ioutil" | |
| 7: "fmt" | |
| 8: ) | |
| 9: | |
| 10: func main() { | |
| => 11: http.HandleFunc("/", webserver) | |
| 12: http.ListenAndServe(":8080", nil) | |
| 13: message := get() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (dlv) continue | |
| > main.main() ./main.go:10 (hits goroutine(1):1 total:1) (PC: 0x6fcb78) | |
| 5: "log" | |
| 6: "io/ioutil" | |
| 7: "fmt" | |
| 8: ) | |
| 9: | |
| => 10: func main() { | |
| 11: http.HandleFunc("/", webserver) | |
| 12: http.ListenAndServe(":8080", nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (dlv) break main.main | |
| Breakpoint 1 set at 0x6fcb78 for main.main() ./main.go:10 | |
| (dlv) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ dlv debug | |
| Type 'help' for list of commands. | |
| (dlv) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func get() string { | |
| // Println debugging! | |
| fmt.Println("Got into func get().") | |
| response, err := http.Get("http://localhost:8080/") | |
| if err != nil { | |
| log.Fatalln(err) | |
| } | |
| // Println debugging! | |
| fmt.Println("Sent GET request.") | |
| message, err := ioutil.ReadAll(response.Body) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "github.com/gorilla/websocket" | |
| "math/rand" | |
| "math" | |
| "net/http" | |
| "os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ├── mesh | |
| │ └── go.mod | |
| │ └── main.go | |
| ├── render | |
| │ └── go.mod | |
| │ └── main.go | |
| └── web | |
| └── go.mod | |
| ├── index.html | |
| └── main.go |