|
@@ -11,12 +11,15 @@ categories: 编程语言
|
|
### 用命令获取第三方包
|
|
### 用命令获取第三方包
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
|
+
|
|
go get -u -v github.com/speps/go-hashids
|
|
go get -u -v github.com/speps/go-hashids
|
|
|
|
+
|
|
```
|
|
```
|
|
|
|
|
|
### 实现如下
|
|
### 实现如下
|
|
|
|
|
|
-```go
|
|
|
|
|
|
+```golang
|
|
|
|
+
|
|
package hashids
|
|
package hashids
|
|
|
|
|
|
import (
|
|
import (
|
|
@@ -43,5 +46,6 @@ func Decode(data string) int {
|
|
e, _ := h.DecodeWithError(data)
|
|
e, _ := h.DecodeWithError(data)
|
|
return e[0]
|
|
return e[0]
|
|
}
|
|
}
|
|
|
|
+
|
|
```
|
|
```
|
|
|
|
|