Sitemap

不要な再デプロイを避けるために再現性のある ZIP を作る

17 min readMay 6, 2025

--

Press enter or click to view image in full size

-X importpath.name=value
Set the value of the string variable in importpath named name to value.
This is only effective if the variable is declared in the source code either uninitialized or initialized to a constant string expression. -X will not work if the initializer makes a function call or refers to other variables.
Note that before Go 1.5 this option took two separate arguments.

https://pkg.go.dev/cmd/link

SOURCE_DATE_EPOCH

A UNIX timestamp, defined as the number of seconds, excluding leap seconds, since 01 Jan 1970 00:00:00 UTC.

The value MUST be exported through the operating system’s usual environment mechanism.

The value MUST be an ASCII representation of an integer with no fractional component, identical to the output format of date +%s.

The value MUST be reproducible (deterministic) across different executions of the build, depending only on the source code. It SHOULD be set to the last modification time of the source, incorporating any packaging-specific modifications.

Build processes MUST use this variable for embedded timestamps in place of the “current” date and time.

Where build processes embed timestamps that are not “current”, but are nevertheless still specific to one execution of the build process, they MUST use a timestamp no later than the value of this variable. This is often called “timestamp clamping”.

Build processes MUST NOT unset this variable for child processes if it is already present.

Formatting MUST be deferred until runtime if an end user should observe the value in their own locale or timezone.

If the value is malformed, the build process SHOULD exit with a non-zero error code.

SOURCE_DATE_EPOCH

If set to any value, disables compression with DEFLATE COMPRESSION CALL. This variable is normally set during reproducible builds, where DEFLATE COMPRESSION CALL must be disabled, because its output may not be reproducible.
https://www.gnu.org/software/gzip/manual/gzip.html

--

--

ぺりー
ぺりー

Written by ぺりー

Satoru Kitaguchi. Software Engineer at Third Intelligence.