+
Skip to content

glibsm/intset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

package intset

Provides an easy way for human-readable int ranges.

This was put together primarily to help manage the year range in the license headers when a file is touched. It may be useful in other applications, but keep in mind this code is not optimized.

Install

go get github.com/glibsm/intset

Example

package main

import (
	"fmt"

	"github.com/glibsm/intset"
)

func main() {
	s := intset.Must(intset.Parse("2012-2014,2017,2018,2019"))
	s.Add(2020)
	fmt.Println(s) // 2012-2014,2017-2020
}

About

Human readable wrapper around []int that squashes ranges

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载