<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《Go语言包管理简史》的评论</title>
	<atom:link href="http://tonybai.com/2019/09/21/brief-history-of-go-package-management/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2019/09/21/brief-history-of-go-package-management/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Wed, 25 Mar 2026 09:21:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2019/09/21/brief-history-of-go-package-management/#comment-7386</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Sat, 12 Oct 2019 03:09:24 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2771#comment-7386</guid>
		<description>go.sum与类似dep的Gopkg.lock文件有区别。不知道您是否细致看过其中的内容：

go.sum内容节选：

github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=

我们看到，go.sum中对同一个module可能有多个版本，并存储不同版本的”校验值“；而lock文件仅仅会存一个固定的版本:

[[projects]]
  branch = &quot;master&quot;
  name = &quot;github.com/bwmarrin/snowflake&quot;
  packages = [&quot;.&quot;]
  revision = &quot;7d434bc4d8a584a6b7998a91e28380786b02cb00&quot;

因此，go.sum实质是用来check，防止下载的module被串改。go.mod起到了原Gopkg.toml和Gopkg.lock的双重作用。</description>
		<content:encoded><![CDATA[<p>go.sum与类似dep的Gopkg.lock文件有区别。不知道您是否细致看过其中的内容：</p>
<p>go.sum内容节选：</p>
<p>github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=<br />
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=<br />
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=</p>
<p>我们看到，go.sum中对同一个module可能有多个版本，并存储不同版本的”校验值“；而lock文件仅仅会存一个固定的版本:</p>
<p>[[projects]]<br />
  branch = “master”<br />
  name = “github.com/bwmarrin/snowflake”<br />
  packages = ["."]<br />
  revision = “7d434bc4d8a584a6b7998a91e28380786b02cb00&#8243;</p>
<p>因此，go.sum实质是用来check，防止下载的module被串改。go.mod起到了原Gopkg.toml和Gopkg.lock的双重作用。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：rrr</title>
		<link>https://tonybai.com/2019/09/21/brief-history-of-go-package-management/#comment-7385</link>
		<dc:creator>rrr</dc:creator>
		<pubDate>Sat, 21 Sep 2019 11:02:11 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2771#comment-7385</guid>
		<description>&gt; 运行go build会创建一个go.sum文件，其中包含特定模块版本的内容的预期校验和。这是为了确保这些模块将来的下载内容与第一次下载是相同的。请注意，go.sum不是锁文件。

这不就是锁文件的作用么</description>
		<content:encoded><![CDATA[<p>&gt; 运行go build会创建一个go.sum文件，其中包含特定模块版本的内容的预期校验和。这是为了确保这些模块将来的下载内容与第一次下载是相同的。请注意，go.sum不是锁文件。</p>
<p>这不就是锁文件的作用么</p>
]]></content:encoded>
	</item>
</channel>
</rss>
