Skip to content

Commit

Permalink
feat: remove unused code and refact test (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq authored Feb 6, 2023
1 parent aaf1bf1 commit aee4978
Show file tree
Hide file tree
Showing 29 changed files with 121 additions and 799 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0
github.com/hnlq715/struct2interface v0.1.4
github.com/iancoleman/strcase v0.2.0
github.com/imdario/mergo v0.3.13
github.com/json-iterator/go v1.1.12
github.com/juju/ratelimit v1.0.2
github.com/labstack/echo/v4 v4.10.0
Expand Down Expand Up @@ -105,6 +104,7 @@ require (
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
github.com/grokify/html-strip-tags-go v0.0.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
Expand Down
47 changes: 0 additions & 47 deletions pkg/util/xcrypto/aes.go

This file was deleted.

238 changes: 0 additions & 238 deletions pkg/util/xmap/map.go

This file was deleted.

19 changes: 0 additions & 19 deletions pkg/util/xmap/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package xmap
import (
"fmt"
"reflect"
"strings"

xcast "github.com/spf13/cast"
)
Expand Down Expand Up @@ -64,24 +63,6 @@ func ToMapStringInterface(src map[interface{}]interface{}) map[string]interface{
return tgt
}

// InsensitiviseMap insensitivise map
func InsensitiviseMap(m map[string]interface{}) {
for key, val := range m {
switch val := val.(type) {
case map[interface{}]interface{}:
InsensitiviseMap(xcast.ToStringMap(val))
case map[string]interface{}:
InsensitiviseMap(val)
}

lower := strings.ToLower(key)
if key != lower {
delete(m, key)
}
m[lower] = val
}
}

// DeepSearchInMap deep search in map
func DeepSearchInMap(m map[string]interface{}, paths ...string) map[string]interface{} {
//深度拷贝
Expand Down
Loading

0 comments on commit aee4978

Please sign in to comment.