提交 c9206300 编写于 作者: D Derek Parker 提交者: Alessandro Arzilli

cmd: Fix trace bug when no package specified

Fix a bug where the regexp would be used as a package string
incorrectly. This would manifest when trying to execute the trace
subcommand as `dlv trace <regexp>` without specifying a package
identifier. The `<regexp>` would be passed to the Go build command
causing an error.
上级 b5cf5845
......@@ -339,6 +339,7 @@ func traceCmd(cmd *cobra.Command, args []string) {
var dlvArgsLen = len(dlvArgs)
if dlvArgsLen == 1 {
regexp = args[0]
dlvArgs = dlvArgs[0:0]
} else if dlvArgsLen >= 2 {
regexp = dlvArgs[dlvArgsLen-1]
dlvArgs = dlvArgs[:dlvArgsLen-1]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册