package
Version:
v1.23.0
Opens a new window with list of versions in this module.
Published: Aug 14, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
versionパッケージは、Goツールチェーン名の構文 のような文字列、
つまり "go1.20"、"go1.21.0"、"go1.22rc2"、"go1.23.4-bigcorp"などの
Goバージョン に対する操作を提供します。
Compareは、x < y、x == y、またはx > yの場合にそれぞれ-1、0、または+1を返します。
これはGoのバージョンとして解釈されます。
バージョンxとyは"go"プレフィックスで始まる必要があります:"go1.21"であり、"1.21"ではありません。
無効なバージョン、空文字列を含む、は有効なバージョンよりも小さく、
お互いに等しいと比較されます。
言語バージョン"go1.21"はリリース候補および最終リリース"go1.21rc1"および"go1.21.0"よりも小さいと比較されます。
IsValidは、バージョンxが有効かどうかを報告します。
Langは、バージョンxのGo言語バージョンを返します。
もしxが有効なバージョンでない場合、Langは空の文字列を返します。
例えば:
Lang("go1.21rc2") = "go1.21"
Lang("go1.21.2") = "go1.21"
Lang("go1.21") = "go1.21"
Lang("go1") = "go1"
Lang("bad") = ""
Lang("1.21") = ""
Source Files
¶
Click to show internal directories.
Click to hide internal directories.