Skip to content

Commit

Permalink
####Version 1.7.18
Browse files Browse the repository at this point in the history
* Bug fix: fix deepcopy middleware not success
* 2021-04-20 13:00 at ShangHai
  • Loading branch information
devfeel committed Apr 20, 2021
1 parent 7a12abd commit 5a28c0e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dotweb
// Global define
const (
// Version current version
Version = "1.7.17"
Version = "1.7.18"
)

// Log define
Expand Down
6 changes: 5 additions & 1 deletion group.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func (g *xGroup) Use(ms ...Middleware) Group {
// deepcopy middleware structs to avoid middleware chain misbehaving
m := []Middleware{}
for _, om := range ms {
newM := reflect.New(reflect.ValueOf(om).Elem().Type()).Interface().(Middleware)
//newM := reflect.New(reflect.ValueOf(om).Elem().Type()).Interface().(Middleware)
newElem := reflect.New(reflect.TypeOf(om).Elem())
newElem.Elem().Set(reflect.ValueOf(om).Elem())
newM := newElem.Interface().(Middleware)

newM.SetNext(nil)
m = append(m, newM)
}
Expand Down
4 changes: 4 additions & 0 deletions version.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## dotweb版本记录:

####Version 1.7.18
* Bug fix: fix deepcopy middleware not success
* 2021-04-20 13:00 at ShangHai

####Version 1.7.17
* Bug fix: fix GetRandString return same result
* 2021-01-29 08:00 at ShangHai
Expand Down

0 comments on commit 5a28c0e

Please sign in to comment.