|
@@ -3,9 +3,7 @@ package util
|
|
|
import (
|
|
|
"crypto/rsa"
|
|
|
"encoding/binary"
|
|
|
- "encoding/json"
|
|
|
"fmt"
|
|
|
- "io"
|
|
|
)
|
|
|
|
|
|
// Signer interface
|
|
@@ -41,23 +39,6 @@ func UintToBytes(v uint) []byte {
|
|
|
return bb
|
|
|
}
|
|
|
|
|
|
-// JSONMarshal func
|
|
|
-func JSONMarshal(w io.Writer, v interface{}) {
|
|
|
- if d, err := json.Marshal(v); err == nil {
|
|
|
- w.Write(d)
|
|
|
- } else {
|
|
|
- panic(err)
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// JSONUnmarshal func
|
|
|
-func JSONUnmarshal(b []byte, v interface{}) interface{} {
|
|
|
- if err := json.Unmarshal(b, v); err != nil {
|
|
|
- panic(err)
|
|
|
- }
|
|
|
- return v
|
|
|
-}
|
|
|
-
|
|
|
// InStringSlice func
|
|
|
func InStringSlice(v string, list ...string) bool {
|
|
|
for _, vl := range list {
|