登录
首页 >  Golang >  Go问答

解释“评估”请求失败时,Visual Studio Code 中 Go 代码运行出现的“noDebug 模式”错误

来源:stackoverflow

时间:2024-02-20 11:27:13 154浏览 收藏

哈喽!大家好,很高兴又见面了,我是golang学习网的一名作者,今天由我给大家带来一篇《解释“评估”请求失败时,Visual Studio Code 中 Go 代码运行出现的“noDebug 模式”错误》,本文主要会讲到等等知识点,希望大家一起学习进步,也欢迎大家关注、点赞、收藏、转发! 下面就一起来看看吧!

问题内容

运行代码并输入内容时发生错误。 在此输入图像描述 它显示“nodebug 模式:无法处理‘评估’请求”。我应该怎么做才能解决这个问题?

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
}

正确答案


请参考 this Github 提出的问题。如前所述,这也可能与 VS Code 有关。

本篇关于《解释“评估”请求失败时,Visual Studio Code 中 Go 代码运行出现的“noDebug 模式”错误》的介绍就到此结束啦,但是学无止境,想要了解学习更多关于Golang的相关知识,请关注golang学习网公众号!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>