【问题标题】:Code display issue in Delve for Go on Windows 10Windows 10 上 Delve for Go 中的代码显示问题
【发布时间】:2019-11-12 14:45:38
【问题描述】:

我在 Windows 10 上安装了 Delve,它似乎可以工作,但显示屏不显示行号,也没有指出当前行。

根据 Delve "Getting Started" 指南,我应该看到类似的东西

(dlv) continue
> main.main() ./test.go:5 (hits goroutine(1):1 total:1) (PC: 0x49ecf3)
     1: package main
     2: 
     3: import "fmt"
     4: 
=>   5: func main() {
     6:     fmt.Println("delve test")
     7: }
(dlv) 

但我看到的更像

(dlv) continue
> main.main() ./test.go:5 (hits goroutine(1):1 total:1) (PC: 0x49ecf3)
        package main

        import "fmt"

        func main() {
            fmt.Println("delve test")
        }
(dlv) 

我可以单步执行代码并显示变量值等,但是缺少当前行指针=> 使其难以使用。

C:> dlv version
Delve Debugger
Version: 1.3.2
Build: $Id: 569ccbd514fc47c8b4c521b142556867ec5e6917 $

C:> go version
go version go1.12.5 windows/amd64

C:>ver
Microsoft Windows [Version 10.0.18362.418]

C:>chcp
Active code page: 850

也许由于 MS Windows 命令提示控制台功能存在问题?是否有解决方法或其他解决方案?

【问题讨论】:

    标签: debugging go windows-console delve


    【解决方案1】:

    如果您使用的是 PowerShell,可能需要更改背景颜色。

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-23
      • 2019-02-16
      • 2017-09-19
      • 1970-01-01
      • 2016-08-18
      • 2021-12-18
      • 2012-01-04
      • 2016-07-01
      相关资源
      最近更新 更多