diff --git a/GcToolchainTricks.md b/GcToolchainTricks.md index 50797a54..1919754e 100644 --- a/GcToolchainTricks.md +++ b/GcToolchainTricks.md @@ -106,4 +106,4 @@ var BuildTime string You can build the program using this package using `go build -ldflags="-X 'company/buildinfo.BuildTime=$(date)'"` to record the build time in the string. (The use of `$(date)` assumes you are using a Unix-style shell.) -The string variable must exist, and it must be a variable, not a constant. There is no warning for using the wrong name in the `-X` option. You can often find the name to use by running `go tool nm` on the program, but that will fail if the package name has any non-ASCII characters, or a `"` or `%` character. \ No newline at end of file +The string variable must exist, it must be a variable, not a constant, and its value must not be initialized by a function call. There is no warning for using the wrong name in the `-X` option. You can often find the name to use by running `go tool nm` on the program, but that will fail if the package name has any non-ASCII characters, or a `"` or `%` character. \ No newline at end of file