Golang学习之路一环境搭建

Golang学习之路一环境搭建

MacBook Linux 树莓派raspberrypi安装Golang环境

官网下载地址: https://golang.google.cn/dl/

在这里插入图片描述

配置golang环境变量

tar -zxvf xxx.tar.gz 解压

vim ~/.bashrc 或 (vim /etc/profile)

#最后添加
export GOROOT=/Users/liang/software/go1.10.3
export PATH=$GOROOT/bin:$PATH
export GOPATH=/Users/liang/ideaWorkspace/go

source ~/.bashrc 或 (source /etc/profile) 配置生效
#查看golfing版本
go version

创建一个golang工作目录

#创建工作目录go 
#需要在上面的环境变量里添加了GOPATH=/Users/liang/ideaWorkspace/go
mkdir -pv /Users/liang/ideaWorkspace/go

工作目录下需要创建三个子目录:
pkg/        // 存放编译是生成的中间文件
bin/        // 存放编译后的二进制可执行文件
src/        // 是存放自己编写的项目,如图

在这里插入图片描述

开发工具

推荐使用:Goland
在这里插入图片描述

下载地址

  • Goland: https://www.jetbrains.com/go/
  • IDEA: https://www.jetbrains.com/idea/
  • VsCode: https://code.visualstudio.com/

参考链接:
https://www.cnblogs.com/zhichaoma/p/12509439.html

相关推荐

  1. Golang学习六运算符

    2023-12-19 15:34:02       37 阅读
  2. golang开发环境

    2023-12-19 15:34:02       45 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-19 15:34:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-19 15:34:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-19 15:34:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-19 15:34:02       20 阅读

热门阅读

  1. 绘制动态图表 Python

    2023-12-19 15:34:02       37 阅读
  2. html懒人加载实现

    2023-12-19 15:34:02       34 阅读
  3. 自动生成请假条 - Python实现

    2023-12-19 15:34:02       36 阅读
  4. 面试记录一

    2023-12-19 15:34:02       31 阅读
  5. [hive] 在hive sql中定义变量

    2023-12-19 15:34:02       39 阅读
  6. vue + nonvc部署

    2023-12-19 15:34:02       78 阅读
  7. Crow:http请求到Rule绑定的handler_的调用链

    2023-12-19 15:34:02       49 阅读
  8. 13.FTP

    13.FTP

    2023-12-19 15:34:02      37 阅读
  9. 【Spring】SpringMVC项目升级成SpringBoot实践

    2023-12-19 15:34:02       53 阅读
  10. npm install老是卡住是什么问题

    2023-12-19 15:34:02       40 阅读