英文:
On Mac OSX 10.8.4 where can I find the Go installation?
问题
我正在遵循这本在线书籍,在周末学习Go语言。
我尝试运行go help gopath
命令,它只返回示例路径以及它们在包和源代码目录中的关系,它并没有告诉我在哪里可以找到go文件夹。
这本书特别提到:
> 首先创建一个新的文件夹,用于存储我们的程序。你在第一章中使用的安装程序创建了一个名为Go的文件夹,位于你的主目录中。创建一个名为~/Go/src/golang-book/chapter2的文件夹。(其中~表示你的主目录)你可以通过终端输入以下命令来完成:
我使用了Go官网上的默认安装程序,所以假设一切都安装在安装程序默认的文件夹中。
如果我在终端中使用cd
命令进入~/
文件夹,然后使用ls
命令,就没有/Go
文件夹。
为了正确地遵循这本在线书籍,我该如何找到这个文件夹?我假设他之所以使用这个文件夹结构是有原因的,而且我宁愿不偏离这个结构,学习包的工作原理等等。
英文:
I'm following this online book in my path to learn Go during the weekends.
I've tried running the go help gopath
command it just returns example paths and how they relate to each other in packages and source directories - it's doesn't actually say where I can find the go folder.
The book specifically mentions:
> First create a new folder where we can store our program. The
> installer you used in chapter 1 created a folder in your home
> directory named Go. Create a folder named
> ~/Go/src/golang-book/chapter2. (Where ~ means your home directory)
> From the terminal you can do this by entering the following commands:
I used the default installer on the Go homepage, so assume that everything installed in the default folder the installer comes with.
If I cd
in terminal to the ~/
folder and then use ls
, there is no /Go
folder.
How can I find this folder in order to follow the online book properly? I'm assuming he's using this folder structure for a reason and would rather not deviate and learn how packages work, etc.
答案1
得分: 0
指南上说:
> 创建一个名为~/Go/src/golang-book/chapter2
的文件夹
我理解这意味着你需要创建名为"~/Go/src/golang-book/chapter2
"的文件夹。安装程序不会创建这个文件夹,但你可以自己创建。
例如,在终端中执行以下命令:
mkdir ~/Go
mkdir ~/Go/src
mkdir ~/Go/src/golang-book
mkdir ~/Go/src/golang-book/chapter2
英文:
The instructions say:
> Create a folder named ~/Go/src/golang-book/chapter2
I interpret that to mean that YOU create the folder named "~/Go/src/golang-book/chapter2
". The installer doesn't create this, but you can.
E.G. in your Terminal:
mkdir ~/Go
mkdir ~/Go/src
mkdir ~/Go/src/golang-book
mkdir ~/Go/src/golang-book/chapter2
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论