窗口中的GOPATH错误“GOPATH条目是相对的;必须是绝对路径:“ [英] GOPATH error in windows "GOPATH entry is relative; must be absolute path: "

查看:479
本文介绍了窗口中的GOPATH错误“GOPATH条目是相对的;必须是绝对路径:“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是GO的新手,在Windows中初始化GOPATH时出错。
在我的项目文件夹中是

C:\ Users \kamin\Documents\pm-manager



,我尝试在环境变量(GOPATH)中设置路径,但它出现错误
go:GOPATH条目是相对的;必须是绝对路径::/ cygdrive / c / Users / kamin / Documents / pm-manager \r \r。
运行'go help gopath'进行使用。

解决方案

碰到同样的问题。修复很简单:只需在整个路径名前面指定驱动器即可。发生此问题是因为我按照Go入门页面上的说明进行操作,并设置了 GOPATH =%HOMEPATH%\Work 。问题在于%HOMEPATH%被定义为相对路径( \Users\MyName ),所以 GOPATH 现在指向 \Users\MyName\Work 。我所需要做的就是设置 GOPATH = c:\ Users \MyName\Work 并且错误消失。


I am new to GO and getting an error when initializing GOPATH in windows. In my project folder is

C:\Users\kamin\Documents\pm-manager

and i am try to set path in environment variable (GOPATH)but it is getting an error go: GOPATH entry is relative; must be absolute path: ":/cygdrive/c/Users/kamin/Documents/pm-manager\r\r". Run 'go help gopath' for usage.

解决方案

Ran into same problem. Fix is quite simple: just specify the drive in front of the entire path name. The issue occurred because I was following the instructions on Go "Getting Started" page and set GOPATH=%HOMEPATH%\Work . The problem was that %HOMEPATH% was defined as a relative path (\Users\MyName), and so GOPATH now pointed to \Users\MyName\Work . All I needed to do was set GOPATH=c:\Users\MyName\Work and the error goes away.

这篇关于窗口中的GOPATH错误“GOPATH条目是相对的;必须是绝对路径:“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆