<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Go语法 on Chen's Blog</title><link>https://NamiChen.github.io/tags/go%E8%AF%AD%E6%B3%95/</link><description>Recent content in Go语法 on Chen's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Sat, 15 Aug 2020 09:47:00 +0800</lastBuildDate><atom:link href="https://NamiChen.github.io/tags/go%E8%AF%AD%E6%B3%95/index.xml" rel="self" type="application/rss+xml"/><item><title>Golang深入学习9-调用栈</title><link>https://NamiChen.github.io/2020/golang-deep-learning-9-call-stack/</link><pubDate>Sat, 15 Aug 2020 09:47:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-9-call-stack/</guid><description>&lt;p>本篇介绍如何分析 Go 的调用栈。&lt;/p></description></item><item><title>Golang深入学习8-堆栈与逃逸分析</title><link>https://NamiChen.github.io/2020/golang-deep-learning-8-stack-heap-and-escape-analysis/</link><pubDate>Sat, 15 Aug 2020 08:47:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-8-stack-heap-and-escape-analysis/</guid><description>&lt;p>本篇介绍 Go 的堆栈和逃逸分析。&lt;/p></description></item><item><title>Golang查漏补缺-定义与声明的区别</title><link>https://NamiChen.github.io/2020/golang-supplement-the-difference-between-definition-and-declaration/</link><pubDate>Sat, 15 Aug 2020 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2020/golang-supplement-the-difference-between-definition-and-declaration/</guid><description>&lt;p>一直都比较纠结这个问题，所以搜了一下答案，记录在这里。&lt;/p></description></item><item><title>Golang深入学习7-调度器与垃圾回收</title><link>https://NamiChen.github.io/2020/golang-deep-learning-7-scheduler-and-garbage-collection/</link><pubDate>Thu, 30 Jul 2020 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-7-scheduler-and-garbage-collection/</guid><description>&lt;p>调度器和垃圾回收都属于 runtime 的一部分，本文我们介绍 Go 中 runtime 的含义，然后再来分析 Go 的调度器和垃圾回收策略。&lt;/p></description></item><item><title>Golang深入学习6-使用pprof进行性能分析</title><link>https://NamiChen.github.io/2020/golang-deep-learning-6-performance-analysis-pprof/</link><pubDate>Mon, 27 Jul 2020 18:46:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-6-performance-analysis-pprof/</guid><description>&lt;p>pprof 用来做 Go 程序的性能监控，让我们知道在什么地方耗费了多少 CPU、memory。&lt;/p></description></item><item><title>Golang深入学习5-使用dlv调试程序</title><link>https://NamiChen.github.io/2020/golang-deep-learning-5-debug-with-dlv/</link><pubDate>Sun, 26 Jul 2020 09:43:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-5-debug-with-dlv/</guid><description>&lt;p>在C/C++中，使用 GDB 调试程序，但在Go中，看过网上的一些文章后，发现 dlv 是个更好的选择，本文进行介绍。&lt;/p></description></item><item><title>Golang深入学习4-map</title><link>https://NamiChen.github.io/2020/golang-deep-learning-4-map/</link><pubDate>Sat, 25 Jul 2020 09:45:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-4-map/</guid><description>&lt;p>本文关心 map 的底层实现、map 的扩容机制和 map 遍历的随机性。&lt;/p></description></item><item><title>Golang深入学习3-切片</title><link>https://NamiChen.github.io/2020/golang-deep-learning-3-slice/</link><pubDate>Fri, 24 Jul 2020 16:13:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-3-slice/</guid><description>&lt;p>本篇理解切片的底层实现和扩容方式。&lt;/p></description></item><item><title>Golang深入学习2-string</title><link>https://NamiChen.github.io/2020/golang-deep-learning-2-string/</link><pubDate>Fri, 24 Jul 2020 11:19:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-2-string/</guid><description>&lt;p>Go 中字符串虽然作为基本数据类型，但本质依然是字符数组，本篇文章理解 Go 底层 string 类型是如何实现的，以及探讨它与 []byte 之间的关系。&lt;/p></description></item><item><title>Golang深入学习1-uintptr 和 Unsafe.Pointer</title><link>https://NamiChen.github.io/2020/golang-deep-learning-1-uintptr-and-unsafe.pointer/</link><pubDate>Thu, 23 Jul 2020 12:15:00 +0800</pubDate><guid>https://NamiChen.github.io/2020/golang-deep-learning-1-uintptr-and-unsafe.pointer/</guid><description>&lt;p>本篇介绍 Go 中的指针、uintptr 和 unsafe.Pointer 三个概念。&lt;/p></description></item><item><title>Golang语法基础12-测试</title><link>https://NamiChen.github.io/2019/golang-syntax-12-test/</link><pubDate>Sun, 22 Dec 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-12-test/</guid><description>实际开发中对代码进行测试是不可缺少的工作，在go中可以通过testing包来进行代码的测试。testing包和go test命令相互配合，能够</description></item><item><title>Golang语法基础11-错误处理</title><link>https://NamiChen.github.io/2019/golang-syntax-11-error-and-panic/</link><pubDate>Fri, 20 Dec 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-11-error-and-panic/</guid><description>&lt;p>Go中有两套错误处理的方式&lt;/p>
&lt;ul>
&lt;li>普通错误： 在函数和方法中返回错误对象作为它们的唯一或最后一个返回值 ，如果返回nil，表示没有错误&lt;/li>
&lt;li>异常：使用panic和recover&lt;/li>
&lt;/ul>
&lt;p>主调函数总是应该检查收到的错误，不要忽略，否则可能导致严重的后果。&lt;/p></description></item><item><title>Golang语法基础10-协程与通道</title><link>https://NamiChen.github.io/2019/golang-syntax-10-goroutine-and-channel/</link><pubDate>Mon, 16 Dec 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-10-goroutine-and-channel/</guid><description>首先来回顾在操作系统中学过的一些概念。进程(processes)是程序执行的基本单位，运行在一个独立的内存地址空间中；一个进程由多个线程(t</description></item><item><title>Golang语法基础8-结构体与方法</title><link>https://NamiChen.github.io/2019/golang-syntax-8-struct-and-method/</link><pubDate>Tue, 26 Nov 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-8-struct-and-method/</guid><description>&lt;p>结构体是一种非常重要的结构，用到的地方非常多，在 Go 中，结构体还是实现面向对象编程的基础。&lt;/p></description></item><item><title>Golang语法基础9-接口与反射</title><link>https://NamiChen.github.io/2019/golang-syntax-9-interface-and-reflect/</link><pubDate>Tue, 26 Nov 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-9-interface-and-reflect/</guid><description>&lt;p>本篇介绍 Golang 中的接口与反射。&lt;/p></description></item><item><title>Golang语法基础7-函数</title><link>https://NamiChen.github.io/2019/golang-syntax-7-function/</link><pubDate>Mon, 25 Nov 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-7-function/</guid><description>1. 函数声明与定义 Go中有三种类型的函数： 普通的带有名字的函数 匿名函数 方法（Methods，在结构体部分介绍） 普通函数声明的基本格式为 1 func functionName(param1 type1,</description></item><item><title>Golang语法基础6-数组、切片与映射</title><link>https://NamiChen.github.io/2019/golang-syntax-6-array-slice-and-map/</link><pubDate>Mon, 18 Nov 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-6-array-slice-and-map/</guid><description>只有基本的数据类型无法适应所有的情况，当需要存储和处理大量数据时，通常会使用数组、映射、链表等数据结构，称之为容器(container)。在</description></item><item><title>Golang语法基础5-字符串操作与输入输出</title><link>https://NamiChen.github.io/2019/golang-syntax-5-string-input-and-output/</link><pubDate>Mon, 11 Nov 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-5-string-input-and-output/</guid><description>&lt;p>本篇介绍字符串的相关操作，涉及&lt;code>string&lt;/code>和&lt;code>strconv&lt;/code>两个标准库，以及介绍输入输出的基本方法，涉及&lt;code>fmt&lt;/code>和&lt;code>bufio&lt;/code>两个标准库。&lt;/p></description></item><item><title>Golang语法基础4-运算符与流程控制</title><link>https://NamiChen.github.io/2019/golang-syntax-4-operators-and-flow-control/</link><pubDate>Tue, 29 Oct 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-4-operators-and-flow-control/</guid><description>&lt;p>本文介绍 Golang 中的运算符和流程控制&lt;/p></description></item><item><title>Golang语法基础3-常量变量与基本数据类型</title><link>https://NamiChen.github.io/2019/golang-syntax-3-constants-variables-and-elementary-types/</link><pubDate>Tue, 22 Oct 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-syntax-3-constants-variables-and-elementary-types/</guid><description>&lt;p>本文介绍 Go 中的常量、变量、基本数据类型和常用的类型转换。&lt;/p></description></item><item><title>Golang语法基础2-命令、包与模块</title><link>https://NamiChen.github.io/2019/golang-basic-grammer-2-command-package-module/</link><pubDate>Thu, 19 Sep 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-basic-grammer-2-command-package-module/</guid><description>本篇介绍Go中的基础命令，包和模块。 1. 命令 Go 在安装后自带一个命令行工具，名为 go，用来下载、编译、安装、测试 Go 的包和源文件，关于 Go CLI 的发展历</description></item><item><title>Golang语法基础1-背景与初探</title><link>https://NamiChen.github.io/2019/golang-basic-grammar-1-background-and-preliminary-exploration/</link><pubDate>Fri, 13 Sep 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang-basic-grammar-1-background-and-preliminary-exploration/</guid><description>1. 起源与发展 Go/Golang 起源于2007年，并于2009年正式对外发布，是一个完全开源的项目，背后的支持者是谷歌公司，核心设计者是三位著名IT工程师：K</description></item><item><title>Golang查漏补缺-bufio读取的字符串无法直接进行类型转换</title><link>https://NamiChen.github.io/2019/golang%E6%9F%A5%E6%BC%8F%E8%A1%A5%E7%BC%BA-bufio%E8%AF%BB%E5%8F%96%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%97%A0%E6%B3%95%E7%9B%B4%E6%8E%A5%E8%BF%9B%E8%A1%8C%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2/</link><pubDate>Tue, 27 Aug 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang%E6%9F%A5%E6%BC%8F%E8%A1%A5%E7%BC%BA-bufio%E8%AF%BB%E5%8F%96%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%97%A0%E6%B3%95%E7%9B%B4%E6%8E%A5%E8%BF%9B%E8%A1%8C%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2/</guid><description>如下列代码，在使用bufio包中的ReadString读取字符串之后，这个字符串无法进行类型转换，每次使用strconv.Atoi()函数返</description></item><item><title>Golang查漏补缺-对自定义类型排序</title><link>https://NamiChen.github.io/2019/golang%E6%9F%A5%E6%BC%8F%E8%A1%A5%E7%BC%BA-%E5%AF%B9%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B%E6%8E%92%E5%BA%8F/</link><pubDate>Fri, 16 Aug 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang%E6%9F%A5%E6%BC%8F%E8%A1%A5%E7%BC%BA-%E5%AF%B9%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B%E6%8E%92%E5%BA%8F/</guid><description>PAT乙级25分的题好多需要根据一个结构体类型的某个字段进行排序，第一次遇到时确实不知所措，然后查了不少解决方案，这里做个总结。 这一问题一般</description></item><item><title>Golang查漏补缺-程序执行时间优化</title><link>https://NamiChen.github.io/2019/golang%E6%9F%A5%E6%BC%8F%E8%A1%A5%E7%BC%BA-%E7%A8%8B%E5%BA%8F%E6%89%A7%E8%A1%8C%E6%97%B6%E9%97%B4%E4%BC%98%E5%8C%96/</link><pubDate>Fri, 16 Aug 2019 00:00:00 +0000</pubDate><guid>https://NamiChen.github.io/2019/golang%E6%9F%A5%E6%BC%8F%E8%A1%A5%E7%BC%BA-%E7%A8%8B%E5%BA%8F%E6%89%A7%E8%A1%8C%E6%97%B6%E9%97%B4%E4%BC%98%E5%8C%96/</guid><description>最近在刷PAT乙级的题，因为PAT考点一般只提供C/C++或Java环境的缘故，网上找到的90%都是C++代码，剩下的又绝大部分是Java，</description></item></channel></rss>