当前位置: 首页 > news >正文

Mac周边环境 goBASIC语言HelloWorld

1. 安装mercurial

Mercurial 是一种轻量级分布式版本号控制系统,採用 Python 语言实现

能够输入hg命令查询系统是否安装mercurial,能够例如以下两种命令安装

$sudo pip install mercurial


成功安装之后

$sudo easy-install mercurial


安装之后。输入hg命令。例如以下内容显示,表示安装成功 mercuria

$ hg

Mercurial Distributed SCM


basic commands:


 add           add the specified files on the next commit

 annotate      show changeset information by line for each file

 clone         make a copy of an existing repository

 commit        commit the specified files or all outstanding changes

 diff          diff repository (or selected files)

 export        dump the header and diffs for one or more changesets

 forget        forget the specified files on the next commit

 init          create a new repository in the given directory

 log           show revision history of entire repository or files

 merge         merge working directory with another revision

 pull          pull changes from the specified source

 push          push changes to the specified destination

 remove        remove the specified files on the next commit

 serve         start stand-alone webserver

 status        show changed files in the working directory

 summary       summarize working directory state

 update        update working directory (or switch revisions)


use "hg help" for the full list of commands or "hg -v" for details

如上命令安装失败。能够直接去下载安装

2. 获取go源码

$hg clone -r release https://go.googlecode.com/hg/ go

warning: go.googlecode.com certificate with fingerprint 3f:8a:ae:12:fc:c2:65:d0:64:42:ee:6f:cc:b3:41:a1:9a:76:6e:8c not verified (check hostfingerprints or web.cacerts config setting)

adding changesets

adding manifests

adding file changes

added 19559 changesets with 68116 changes to 8835 files

updating to branch release-branch.go1.3

4167 files updated, 0 files merged, 0 files removed, 0 files unresolved

会在当前路径创建go文件夹

3.安装go

进入 go源代码(go/src)文件夹进行安装,运行例如以下命令

$ ./all.bash

最后会显示出例如以下内容


ALL TESTS PASSED


---

Installed Go for darwin/amd64 in /Users/angel/iProject/go

Installed commands in /Users/angel/iProject/go/bin

*** You need to add /Users/angel/iProject/go/bin to your PATH.

4.编写HelloWorld

$ cat helloworld.go 

package main


import (

    "fmt"

)



func main(){

    fmt.Println("Hello World")

}

5.执行程序

$ go run helloworld.go 

Hello World


參考 链接

版权声明:本文博客原创文章。博客,未经同意,不得转载。

转载于:https://www.cnblogs.com/yxwkf/p/4717922.html

相关文章:

  • linux内存管理系统后期的内核对zonelist的简化
  • bzoj3809: Gty的二逼妹子序列
  • linux内核page结构体的PG_referenced和PG_active标志
  • 解決BufferedReader读取UTF-8文件中文乱码(转)
  • 问题以及发现问题和解决问题
  • bitmap格式分析(转)
  • 关于数组或集合中判断存在某个元素
  • kexec机制
  • Spring事务配置的五种方式
  • buffer_head和bio
  • 关于人脸识别,稀疏表示的若干论文的小结
  • asp.net——正则表达式
  • 开始iOS 7中自动布局教程(一)
  • POJ 1470 Closest Common Ancestors
  • S3C2440-中文手册
  • [译] 理解数组在 PHP 内部的实现(给PHP开发者的PHP源码-第四部分)
  • docker python 配置
  • ES6 ...操作符
  • HTML5新特性总结
  • HTTP中GET与POST的区别 99%的错误认识
  • javascript 总结(常用工具类的封装)
  • LeetCode29.两数相除 JavaScript
  • Python3爬取英雄联盟英雄皮肤大图
  • spring-boot List转Page
  • tweak 支持第三方库
  • vue2.0一起在懵逼的海洋里越陷越深(四)
  • windows下如何用phpstorm同步测试服务器
  • 巧用 TypeScript (一)
  • 如何用Ubuntu和Xen来设置Kubernetes?
  • 入口文件开始,分析Vue源码实现
  • 学习笔记TF060:图像语音结合,看图说话
  • [地铁译]使用SSD缓存应用数据——Moneta项目: 低成本优化的下一代EVCache ...
  • Play Store发现SimBad恶意软件,1.5亿Android用户成受害者 ...
  • 曜石科技宣布获得千万级天使轮投资,全方面布局电竞产业链 ...
  • ​MySQL主从复制一致性检测
  • !$boo在php中什么意思,php前戏
  • ( 用例图)定义了系统的功能需求,它是从系统的外部看系统功能,并不描述系统内部对功能的具体实现
  • (三)c52学习之旅-点亮LED灯
  • (十五)Flask覆写wsgi_app函数实现自定义中间件
  • (四)搭建容器云管理平台笔记—安装ETCD(不使用证书)
  • (转)Android中使用ormlite实现持久化(一)--HelloOrmLite
  • (转)jdk与jre的区别
  • *_zh_CN.properties 国际化资源文件 struts 防乱码等
  • .net core使用RPC方式进行高效的HTTP服务访问
  • .NET框架
  • @DependsOn:解析 Spring 中的依赖关系之艺术
  • @select 怎么写存储过程_你知道select语句和update语句分别是怎么执行的吗?
  • []常用AT命令解释()
  • [100天算法】-不同路径 III(day 73)
  • [2018][note]用于超快偏振开关和动态光束分裂的all-optical有源THz超表——
  • [383] 赎金信 js
  • [8-23]知识梳理:文件系统、Bash基础特性、目录管理、文件管理、文本查看编辑处理...
  • [BZOJ 3531][Sdoi2014]旅行(树链剖分+线段树)
  • [C/C++]数据结构----顺序表的实现(增删查改)
  • [C语言]——内存函数