<?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 清水泥沙</title>
    <link>https://869413421.github.io/categories/go%E6%A0%B8%E5%BF%83/</link>
    <description>Recent content in Go核心 on 清水泥沙</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-zh</language>
    <lastBuildDate>Tue, 07 Feb 2023 15:52:40 +0800</lastBuildDate><atom:link href="https://869413421.github.io/categories/go%E6%A0%B8%E5%BF%83/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Go核心(调试Go源代码)</title>
      <link>https://869413421.github.io/post/go%E6%A0%B8%E5%BF%83/%E8%B0%83%E8%AF%95go%E6%BA%90%E4%BB%A3%E7%A0%81/</link>
      <pubDate>Tue, 07 Feb 2023 15:52:40 +0800</pubDate>
      
      <guid>https://869413421.github.io/post/go%E6%A0%B8%E5%BF%83/%E8%B0%83%E8%AF%95go%E6%BA%90%E4%BB%A3%E7%A0%81/</guid>
      <description>编译安装Go 获取源代码 在编译安装之前我们需要获取到相关的代码，golang作为一个开源项目，我们能在各个开源平台上获取到源代码。这里从Github获取到最新的主干代码，截止行文前最新的代码版本为测试版本的1.20。
git clone https://github.com/golang/go.git goroot 安装Go 当前版本Go已经完成了自举（自举即用Go来完成了Go的编译器的编写），所以在编译安装高版本的的Go时，请确保已经安装了编译器所需版本的GO。如当前我需要编译的版本为1.20，所需的编译器最低为1.17.3版本的Go。所以编译安装1.20版本的前提是本机已经安装好1.17.3版本的Go，具体如何安装这里不再赘述。执行前设置好GOROOT_BOOTSTRAP环境变量，即为低版本Go的安装路径。
修改环境变量 # vim /etc/profile export GOROOT_BOOTSTRAP=/usr/local/go1.17.3 # 你的低版本GO的安装路径 # 重新加载环境变量 source /etc/profile 执行安装命令 cd src/ # linux ./make.bash # windows ./make.bat 安装完成 windows下执行
$ ./make.bat Building Go cmd/dist using E:\go\src\github\869413421\go1.18. (go1.18 windows/amd64) Building Go toolchain1 using E:\go\src\github\869413421\go1.18. Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1. Building Go toolchain2 using go_bootstrap and Go toolchain1. Building Go toolchain3 using go_bootstrap and Go toolchain2. Building packages and commands for windows/amd64.</description>
    </item>
    
  </channel>
</rss>
