dongqi4085 2017-10-26 15:31 采纳率: 0%
浏览 421
已采纳

与VSCODE一起运行不起作用

i've installed the latest go (I saw the go outout with go -v in the command line )

I've installed go plugins to vs code and restart and create some simple file like following

main.go

package main

import (
    "fmt"
)

func main() {

    fmt.Println("hello world");
}

when I run it (with run option plugin , click on file and run) I got error in the console

[Running] go run "/Users/i076777/GoProjects/GoProjTest/main.go"
/bin/sh: go: command not found

Any idea what Im missing here ?

I've also try the following which doesnt work Ive MAC and I see in env GOROOT="/usr/local/go" and I use 'export PATH=$PATH:/usr/local/go/' and its not working.

  • 写回答

1条回答 默认 最新

  • dotwc62080 2017-10-26 15:34
    关注

    You are missing go in your path it looks like. Check with echo $PATH and you should have :/c/Go/bin: in it somewhere (or the folder you installed go to).

    As a side test, open a command prompt / shell and type go env - if it is in your path you should get your go environment variables showing - if they do appear, please update the question.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作