Skip to content

Commit 7fb7062

Browse files
committed
accept int ids
1 parent 6e9c7a8 commit 7fb7062

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

trashid/hashid.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ func init() {
1717
}
1818

1919
func DecodeHashId(id string) (int, error) {
20+
if val, err := strconv.Atoi(id); err == nil {
21+
return val, nil
22+
}
2023
ids, err := hashIdUtil.DecodeWithError(id)
2124
if err != nil {
2225
return 0, err

0 commit comments

Comments
 (0)