From b03b68bfd53c8ba0103973fc16f69bd1d80e31e7 Mon Sep 17 00:00:00 2001 From: pengshiyu <1940607002@qq.com> Date: Wed, 24 Aug 2022 10:51:45 +0800 Subject: [PATCH] fix --- blog/golang/golang-brief.md | 45 ++++++++++++++++++++++++ blog/golang/golang-install.md | 64 +++++++++++++++++++++++++++++++++++ blog/golang/golang-start.md | 20 +++++++++++ blog/golang/index.md | 18 ++++++++++ doc/go.md | 2 ++ 5 files changed, 149 insertions(+) create mode 100644 blog/golang/golang-brief.md create mode 100644 blog/golang/golang-install.md create mode 100644 blog/golang/golang-start.md create mode 100644 blog/golang/index.md diff --git a/blog/golang/golang-brief.md b/blog/golang/golang-brief.md new file mode 100644 index 0000000..d14e961 --- /dev/null +++ b/blog/golang/golang-brief.md @@ -0,0 +1,45 @@ +# 第二章 Golang 概述 + +程序:完成某个功能的指令的集合 + +Go语言:Google公司创造的语言 + +## Go语言发展简史 + +- 2007年原型 +- 2009发布 +- 2015 Go 1.5 +- 2017 Go 1.8 +- 2017 Go 1.9 +- 2018 Go 1.10 + +课程使用的版本:1.9.2 + +## Go语言特点 + +既能有静态编译语言的安全和性能,又能达到动态语言开发维护的效率 + +``` +Go = C + Python +``` + +- 指针 +- 包:Go语言的每一个文件都要归属于一个包,能不能单独存在 +- 垃圾回收 +- 天然并发 goroutine +- 管道通信机制 +- 函数可以返回多个值 +- 切片 + +## Go语言开发工具 + +- VSCode [https://code.visualstudio.com/](https://code.visualstudio.com/) +- VSCode网页版 [https://vscode.dev/](https://vscode.dev/) +- Sublime Text [https://www.sublimetext.com/](https://www.sublimetext.com/) +- Vim +- Emacs +- Eclipse +- LiteIDE +- GoLand [https://www.jetbrains.com/go/](https://www.jetbrains.com/go/) + +建议:初学者使用文本编辑器,工作时使用IDE diff --git a/blog/golang/golang-install.md b/blog/golang/golang-install.md new file mode 100644 index 0000000..4d832a4 --- /dev/null +++ b/blog/golang/golang-install.md @@ -0,0 +1,64 @@ +# 第三章 Golang 开发环境搭建 + +## 安装 VSCode + +Linux 建议安装到 /opt 目录 + +Mac 查看ssh服务 + +```bash +$ sudo launchctl list | grep ssh +- 0 com.openssh.sshd +``` + +## 安装 Golang + +以Mac 环境为例 + +下载地址: + +- https://golang.org/dl/ +- https://golang.google.cn/dl/ + +下载解压 + +```bash +wget https://golang.google.cn/dl/go1.9.2.darwin-amd64.tar.gz + +tar -zxvf go1.9.2.darwin-amd64.tar.gz +``` + +添加至 PATH 环境变量 + +```bash +vim ~/.bash_profile + +export PATH="$PATH:/usr/local/golang/1.9.2/bin" +``` + +执行生效 +```bash +$ source ~/.bash_profile + +$ go version +go version go1.9.2 darwin/amd64 +``` + +代码测试 + +```go +// demo.go +package main + +import "fmt" + +func main(){ + fmt.Println("Hello Golang") +} +``` + +执行 +```bash +$ go run demo.go +Hello Golang +``` \ No newline at end of file diff --git a/blog/golang/golang-start.md b/blog/golang/golang-start.md new file mode 100644 index 0000000..3d23f69 --- /dev/null +++ b/blog/golang/golang-start.md @@ -0,0 +1,20 @@ +# 第一章 Golang开山篇 + +Go言语 Golang + +## 学习方向 + +- 区块链(分布式账本技术) +- Go服务器端/游戏软件/数据处理/处理大并发 +- Golang分布式/云计算 + +## 应用领域 + +- 区块链技术,简称BT(Blockchain Technology),分布式账本技术 +- 后端服务器应用 +- 云计算、云服务 CDN(内容分发网络) + +## 学习方法 + +- 先建立整体框架,然后细节 +- 学习软件编程是在琢磨别人怎么做,而不是我认为应该怎么做的过程 diff --git a/blog/golang/index.md b/blog/golang/index.md new file mode 100644 index 0000000..61099b1 --- /dev/null +++ b/blog/golang/index.md @@ -0,0 +1,18 @@ +# 笔记: Golang 核心编程 + +学习资料 + +- 官网:[https://golang.google.cn/](https://golang.google.cn/) +- Go 语言教程 | 菜鸟教程 [https://www.runoob.com/go/go-tutorial.html](https://www.runoob.com/go/go-tutorial.html) +- 视频:[【尚硅谷】Golang入门到实战教程丨一套精通GO语言](https://www.bilibili.com/video/BV1ME411Y71o) +- TIOBE [https://www.tiobe.com/tiobe-index/](https://www.tiobe.com/tiobe-index/) + +## 目录 + +[第一章 Golang开山篇](blog/golang/golang-start.md) + +[第二章 Golang 概述](blog/golang/golang-brief.md) + +[第三章 Golang 开发环境搭建](blog/golang/golang-install.md) + +https://www.bilibili.com/video/BV1ME411Y71o?p=12&spm_id_from=pageDriver&vd_source=efbb4dc944fa761b6e016ce2ca5933da \ No newline at end of file diff --git a/doc/go.md b/doc/go.md index 6e97bd9..c436641 100644 --- a/doc/go.md +++ b/doc/go.md @@ -1,3 +1,5 @@ # Go语言 [LeetCode Cookbook (Go)](https://books.halfrost.com/leetcode/) + +[笔记: Golang 核心编程](blog/golang/index.md) \ No newline at end of file -- GitLab