doc: fix typo and improve docs for sorting
This commit is contained in:
parent
78d2fa7a60
commit
8c998c0043
10
godoc.md
10
godoc.md
|
@ -11,7 +11,7 @@ Package tagcmp provides image tag comparison operations\.
|
|||
## Index
|
||||
|
||||
- [Variables](<#variables>)
|
||||
- [func IsParseable(tag string) bool](<#func-isparseable>)
|
||||
- [func IsParsable(tag string) bool](<#func-isparsable>)
|
||||
- [type ByTag](<#type-bytag>)
|
||||
- [func (t ByTag) Len() int](<#func-bytag-len>)
|
||||
- [func (t ByTag) Less(i, j int) bool](<#func-bytag-less>)
|
||||
|
@ -57,17 +57,17 @@ StringPattern matches when tags are only made up of alphabetic characters
|
|||
var StringPattern = "^[a-zA-Z]+$"
|
||||
```
|
||||
|
||||
## func IsParseable
|
||||
## func IsParsable
|
||||
|
||||
```go
|
||||
func IsParseable(tag string) bool
|
||||
func IsParsable(tag string) bool
|
||||
```
|
||||
|
||||
IsParseable determines if a tag is supported by this library
|
||||
IsParsable determines if a tag is supported by this library
|
||||
|
||||
## type ByTag
|
||||
|
||||
ByTag sorts tags
|
||||
ByTag sorts tags in asc/desc order where the last element is the latest tag\.
|
||||
|
||||
```go
|
||||
type ByTag []Tag
|
||||
|
|
|
@ -18,7 +18,7 @@ type Tag struct {
|
|||
UsesV bool // whether or not the tag uses the "v" prefix
|
||||
}
|
||||
|
||||
// ByTag sorts tags
|
||||
// ByTag sorts tags in asc/desc order where the last element is the latest tag.
|
||||
type ByTag []Tag
|
||||
|
||||
func (t ByTag) Len() int { return len(t) }
|
||||
|
@ -299,8 +299,8 @@ func Parse(tag string) (Tag, error) {
|
|||
return parsedTag, nil
|
||||
}
|
||||
|
||||
// IsParseable determines if a tag is supported by this library
|
||||
func IsParseable(tag string) bool {
|
||||
// IsParsable determines if a tag is supported by this library
|
||||
func IsParsable(tag string) bool {
|
||||
if _, err := Parse(tag); err != nil {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue