GO语言学习(二、开发工具)

LiteIDE
LiteIDE 是一款开源、跨平台的轻量级 Go 语言集成开发环境(IDE)。

支持的 操作系统
Windows x86 (32-bit or 64-bit)
Linux x86 (32-bit or 64-bit)
下载地址 :http://sourceforge.net/projects/liteide/files/

源码地址 :https://github.com/visualfc/liteide
在这里插入图片描述

Eclipse
Eclipse 也是非常常用的开发利器,以下介绍如何使用 Eclipse 来编写 Go 程序。
在这里插入图片描述
Eclipse 编辑 Go 的主界面

1 首先下载并安装好 Eclipse
2 下载 goclipse 插件https://github.com/GoClipse/goclipse/blob/latest/documentation/Installation.md#installation
3 下载 gocode,用于 go 的代码补全提示

gocode 的 github 地址:

https://github.com/nsf/gocode
在 Windows下要安装 git,通常用 msysgit。

再在 cmd 下安装:

go get -u github.com/nsf/gocode
也可以下载代码,直接用 go build 来编译,会生成 gocode.exe

4 下载 MinGW 并按要求装好
5 配置插件
Windows->Reference->Go

(1)、配置 Go 的编译器
在这里插入图片描述

设置 Go 的一些基础信息

(2)、配置 Gocode(可选,代码补全),设置 Gocode 路径为之前生成的 gocode.exe 文件
在这里插入图片描述

设置 gocode 信息

(3)、配置 GDB(可选,做调试用),设置 GDB 路径为 MingW 安装目录下的 gdb.exe 文件
在这里插入图片描述

设置 GDB 信息

6 测试是否成功

新建一个 go 工程,再建立一个 hello.go。如下图:
在这里插入图片描述

新建项目编辑文件

调试如下(要在 console 中用输入命令来调试):
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/cjl0503/article/details/83621296
今日推荐