version

package
v1.2023.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package version 提供版本的相关信息

依据 https://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/ 提供的数据, 以年作为单位进行更新,同时也以四位的年份作为版本号。

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidYear = fmt.Errorf("无效的版本号,必须是介于 [%d,%d] 之间的整数", start, latest)

ErrInvalidYear 无效的年份版本

年份只能介于 [2009, 当前年份-1) 的区间之间。

Functions

func All

func All() []int

All 返回支持的版本号列表

func BeginWith added in v0.3.0

func BeginWith(begin int) []int

BeginWith 从 begin 开始直到最新年份

func IsValid added in v0.3.0

func IsValid(year int) bool

IsValid 验证年份是否为一个有效的版本号

func Range added in v1.2021.2

func Range(begin, end int) []int

Range 获取指定范围内的版本号

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL