summaryrefslogtreecommitdiff
path: root/devdocs/go/go%2Fversion%2Findex.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/go/go%2Fversion%2Findex.html
new repository
Diffstat (limited to 'devdocs/go/go%2Fversion%2Findex.html')
-rw-r--r--devdocs/go/go%2Fversion%2Findex.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/devdocs/go/go%2Fversion%2Findex.html b/devdocs/go/go%2Fversion%2Findex.html
new file mode 100644
index 00000000..88e5dc66
--- /dev/null
+++ b/devdocs/go/go%2Fversion%2Findex.html
@@ -0,0 +1,23 @@
+<h1> Package version </h1> <ul id="short-nav">
+<li><code>import "go/version"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package version provides operations on <a href="https://go.dev/doc/toolchain#version">Go versions</a> in <a href="https://go.dev/doc/toolchain#name">Go toolchain name syntax</a>: strings like "go1.20", "go1.21.0", "go1.22rc2", and "go1.23.4-bigcorp". </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Compare">func Compare(x, y string) int</a></li>
+<li><a href="#IsValid">func IsValid(x string) bool</a></li>
+<li><a href="#Lang">func Lang(x string) string</a></li>
+</ul> <h3>Package files</h3> <p> <span>version.go</span> </p> <h2 id="Compare">func <span>Compare</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Compare(x, y string) int</pre> <p>Compare returns -1, 0, or +1 depending on whether x &lt; y, x == y, or x &gt; y, interpreted as Go versions. The versions x and y must begin with a "go" prefix: "go1.21" not "1.21". Invalid versions, including the empty string, compare less than valid versions and equal to each other. The language version "go1.21" compares less than the release candidate and eventual releases "go1.21rc1" and "go1.21.0". </p>
+<h2 id="IsValid">func <span>IsValid</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func IsValid(x string) bool</pre> <p>IsValid reports whether the version x is valid. </p>
+<h2 id="Lang">func <span>Lang</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Lang(x string) string</pre> <p>Lang returns the Go language version for version x. If x is not a valid version, Lang returns the empty string. For example: </p>
+<pre data-language="go">Lang("go1.21rc2") = "go1.21"
+Lang("go1.21.2") = "go1.21"
+Lang("go1.21") = "go1.21"
+Lang("go1") = "go1"
+Lang("bad") = ""
+Lang("1.21") = ""
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/version/" class="_attribution-link">http://golang.org/pkg/go/version/</a>
+ </p>
+</div>