Skip to content

Commit

Permalink
bump to v1.10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
hedzr committed Jan 31, 2022
1 parent a57667b commit 2d1e48b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## Versions

- v1.10.10
- v1.10.11
- fix: setNx bug at last commit
- fix: send 1.10.10 failure

- v1.10.9
- fix: setNx with slices merging
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ and Bonus of [#cmdr](https://github.com/topics/cmdr) Series:
- english documentation NOT completed yet
- documentation at: https://hedzr.github.io/cmdr-docs/

- v1.10.11 (WIP)
- v1.10.13 (WIP)

- v1.10.10
- v1.10.11
- fix: setNx bug at last commit
- fix: send 1.10.10 failure

- v1.10.9
- fix: setNx with slices merging
Expand Down
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
// AppName const
AppName = "cmdr"
// Version const
Version = "1.10.10"
Version = "1.10.11"
// VersionInt const
VersionInt = 0x010a0a
VersionInt = 0x010a0b
)
25 changes: 17 additions & 8 deletions options_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,16 +938,25 @@ func mergeSlice(v1, v2 interface{}) (v3 interface{}) {
x4 = reflect.Append(x4, x1.Index(i).Convert(typ))
}
for i := 0; i < x2.Len(); i++ {
if x2.Index(i).CanConvert(typ) {
x4 = reflect.Append(x4, x2.Index(i).Convert(typ))
if typ.Kind() == reflect.String {
str := fmt.Sprintf("%v", x2.Interface())
x4 = reflect.Append(x4, reflect.ValueOf(str))
} else {
if typ.Kind() == reflect.String {
str := fmt.Sprintf("%v", x2.Interface())
x4 = reflect.Append(x4, reflect.ValueOf(str))
} else {
ferr("cannot convert '%v' to type: %v", x2.Interface(), typ.Kind())
}
x4 = reflect.Append(x4, x2.Index(i).Convert(typ))
}

// Just for go1.17+
//
//if x2.Index(i).CanConvert(typ) {
// x4 = reflect.Append(x4, x2.Index(i).Convert(typ))
//} else {
// if typ.Kind() == reflect.String {
// str := fmt.Sprintf("%v", x2.Interface())
// x4 = reflect.Append(x4, reflect.ValueOf(str))
// } else {
// ferr("cannot convert '%v' to type: %v", x2.Interface(), typ.Kind())
// }
//}
}
v3 = x4.Interface()
} else {
Expand Down

0 comments on commit 2d1e48b

Please sign in to comment.