Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/frontend: update logic for truncated version strings
The logic for formatVersion is updated. For pseudo versions, the version string will use a short commit hash of 7 characters to identify the version, and hide timestamp using ellipses: 1. vX.0.0-yyyymmddhhmmss-abcdefabcdef formatVersion("v0.0.0-20200710095922-abcdefabcdef") => "v0.0.0-...-abcdefa" 2. vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef formatVersion("v1.5.2-pre.0.20200331155302-abcdefabcdef") => "v1.5.2-pre.0...-abcdefa" 3. vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdefabcdef formatVersion("v1.5.2-0.20200201180026-77c1076d39f7") => "v1.5.2-0...-abcdefa" For any version string longer than 25 characters, the pre-release string will be truncated, such that the string displayed is exactly 25 characters, including the ellipses: formatVersion("v1.0.0-longprereleasestring") => "v1.0.0-longprereleasestri..." formatVersion("v1.0.0-pre-release.0.20200420093620-87861123c523") => "v1.0.0-pre-rel...-abcdefa" For golang/go#38542 Change-Id: I07441bc17799f5e445f36834556aa15dc87506e3 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254578 Trust: Julie Qiu <julie@golang.org> Run-TryBot: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
- Loading branch information
Showing
3 changed files
with
88 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters