社区频道地址:https://bbs.csdn.net/topics/603677526 Go+ 是什么?为数据而生,实现教学、工程与数据的 “三位一体”。 Go+官方网站: https:// 一、环境搭建1.官网下载go首先去Go官网下载go:https://golang.google.cn/dl/ 2.配置Go环境变量跟其他语言一样,为了可以在cmd命令窗口随时随地输入命令,我们还需要配置环境变量。找到高级系统设置中的环境变量 package main import "fmt" func main() { fmt.Println("Hello, World!")} test.go 运行成功,截图如下: 3.安装GO+(1)下载Go+安装包 官方 GitHub 地址:https://github.com/goplus/gop 复制http链接,使用git下载 git clone https://github.com/goplus/gop.git (2)配置Go+环境变量 配置【环境变量】 二、使用命令行尝试输出 “Hello World”首先我在gop文件夹里又新建了一个gop文件夹,新建一个main.txt 文件 println "Hello World" 输入如下命令 gop mod init gop gop run main.gop 运行出错了,我搜了一下错误原因,原来还需要去添加第三方工具包 go get github.com/goplus/gop/builtin 如果还是不行可以试试如下命令 go env -w GO111MODULE=ongo env -w GOPROXY=https://,direct 之后再输入 三、使用 VScode 中的 goplus 插件输出 “Hello World”首先在插件中搜索【goplus】点击安装
println "Hello World" 选择运行和调试 —> 创建 // .vscode\launch.json{"version": "0.0.1","configurations": [{"name": "gop run","type": "node","request": "launch","runtimeExecutable":"gop","cwd": "${workspaceFolder}","program": "${file}","runtimeArgs": ["run"],"environment":[],"console": "integratedTerminal",}]} 最后一步: 到此我们就完成了环境搭建并用命令行和 VScode 输出 “Hello World”。感兴趣的同学可以通过下方链接查看本次征文的相关事宜,奖品丰富。 |
|