美文网首页
安装 GO + Goland + helloworld

安装 GO + Goland + helloworld

作者: 咩咩的毛球 | 来源:发表于2019-06-21 15:45 被阅读0次

macOS

安装 GO
  1. 安装包:https://golang.org/dl/,下载解压

  2. 编辑~/.bash_profile
    $ vi ~/.bash_profile
    添加两条环境变量
    $ export GOROOT=/usr/local/go
    $ export PATH=$PATH:$GOROOT/bin
    source 使之生效
    $ source ~/.bash_profile

    说明:

    • GOROOT 是 GO 的安装路径
    • go version 检测是否安装成功
安装开发工具 Goland
  1. 安装包:https://www.jetbrains.com/go/download/#section=mac
  2. 学生信息验证,获得注册码
  3. 使用 添加 gopath 和项目 path
  4. Helloworld
    package main
    import "fmt"
    func main(){
            fmt.Println("hello world")
    }
    

点击run

Go / Golang 适合做什么:

类 C 语言

  • 内存数据库、云平台,目前国外很多云平台在采用Go开发
  • 服务器编程,例如处理日志、数据打包、虚拟机处理、文件系统等
  • Web服务器和游戏服务器, 特别是手游服务器

相关文章

网友评论

      本文标题:安装 GO + Goland + helloworld

      本文链接:https://www.haomeiwen.com/subject/aroyqctx.html