What's the error "noDebug mode: unable to process 'evaluate' request" means when I use visual studio code to run Go?

huangapple go评论93阅读模式
英文:

What's the error "noDebug mode: unable to process 'evaluate' request" means when I use visual studio code to run Go?

问题

当我运行代码并输入一些内容时,出现了一个错误。它显示“noDebug mode: unable to process 'evaluate' request”。我应该怎么解决这个问题?

package main

import "fmt"

func main() {
	for {
		fmt.Println("欢迎来到数学世界。输入1进行加法,输入2进行减法,输入3进行乘法,输入4进行除法")
		choice := 0
		fmt.Scanf("%d", &choice)
		var a, b int
		fmt.Scanf("%d %d", &a, &b)
		switch choice {
		case 1:
			fmt.Println(add(a, b))
		case 2:
			fmt.Println(subtract(a, b))
		case 3:
			fmt.Println(multiply(a, b))
		case 4:
			fmt.Println(divide(a, b))
		default:
			fmt.Println("该选项不存在!")
		}
	}
}

func add(a, b int) int {
	return a + b
}

func subtract(a, b int) int {
	return a - b
}

func multiply(a, b int) int {
	return a * b
}

func divide(a, b int) int {
	return a / b
}

图片描述

英文:

An error occured when I run the code and input something.
enter image description here
It says "noDebug mode: unable to process 'evaluate' request" .What should I do to solve this problem?

package main

import "fmt"

func main() {
	for {
		fmt.Println("Welcome to math world.Input 1 to an addiction,2 to a subtraction,3 to a multiplication,4 to a division")
		choice := 0
		fmt.Scanf("%d", &choice)
		var a, b int
		fmt.Scanf("%d %d", &a, &b)
		switch choice {
		case 1:
			fmt.Println(add(a, b))
		case 2:
			fmt.Println(subtract(a, b))
		case 3:
			fmt.Println(multiply(a, b))
		case 4:
			fmt.Println(divide(a, b))
		default:
			fmt.Println("The order is not exist!")
		}
	}
}

func add(a, b int) int {
	return a + b
}

func subtract(a, b int) int {
	return a - b
}

func multiply(a, b int) int {
	return a * b
}
func divide(a, b int) int {
	return a / b
}

答案1

得分: 1

请参考这个提出的Github问题。据说这可能与VS Code有关。

英文:

Please refer to this Github issue raised. This may be related to VS Code too as stated.

huangapple
  • 本文由 发表于 2022年4月30日 17:30:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/72067250.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定