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

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

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”。我应该怎么解决这个问题?

  1. package main
  2. import "fmt"
  3. func main() {
  4. for {
  5. fmt.Println("欢迎来到数学世界。输入1进行加法,输入2进行减法,输入3进行乘法,输入4进行除法")
  6. choice := 0
  7. fmt.Scanf("%d", &choice)
  8. var a, b int
  9. fmt.Scanf("%d %d", &a, &b)
  10. switch choice {
  11. case 1:
  12. fmt.Println(add(a, b))
  13. case 2:
  14. fmt.Println(subtract(a, b))
  15. case 3:
  16. fmt.Println(multiply(a, b))
  17. case 4:
  18. fmt.Println(divide(a, b))
  19. default:
  20. fmt.Println("该选项不存在!")
  21. }
  22. }
  23. }
  24. func add(a, b int) int {
  25. return a + b
  26. }
  27. func subtract(a, b int) int {
  28. return a - b
  29. }
  30. func multiply(a, b int) int {
  31. return a * b
  32. }
  33. func divide(a, b int) int {
  34. return a / b
  35. }

图片描述

英文:

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?

  1. package main
  2. import "fmt"
  3. func main() {
  4. for {
  5. fmt.Println("Welcome to math world.Input 1 to an addiction2 to a subtraction3 to a multiplication4 to a division")
  6. choice := 0
  7. fmt.Scanf("%d", &choice)
  8. var a, b int
  9. fmt.Scanf("%d %d", &a, &b)
  10. switch choice {
  11. case 1:
  12. fmt.Println(add(a, b))
  13. case 2:
  14. fmt.Println(subtract(a, b))
  15. case 3:
  16. fmt.Println(multiply(a, b))
  17. case 4:
  18. fmt.Println(divide(a, b))
  19. default:
  20. fmt.Println("The order is not exist!")
  21. }
  22. }
  23. }
  24. func add(a, b int) int {
  25. return a + b
  26. }
  27. func subtract(a, b int) int {
  28. return a - b
  29. }
  30. func multiply(a, b int) int {
  31. return a * b
  32. }
  33. func divide(a, b int) int {
  34. return a / b
  35. }

答案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:

确定