Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoranz758 committed Oct 16, 2023
1 parent 613ddcb commit dee4aaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/app/server/binding/internal/decoder/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func GetReqDecoder(rt reflect.Type, byTag string, config *DecodeConfig) (Decoder
}, needValidate, nil
}

func getFieldDecoder(field reflect.StructField, index int, parentIdx []int, parentJSONName string, byTag string, config *DecodeConfig) ([]fieldDecoder, bool, error) {
func getFieldDecoder(field reflect.StructField, index int, parentIdx []int, parentJSONName, byTag string, config *DecodeConfig) ([]fieldDecoder, bool, error) {
for field.Type.Kind() == reflect.Ptr {
field.Type = field.Type.Elem()
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/app/server/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,15 @@ func WithDisablePrintRoute(b bool) config.Option {
// WithSenseClientDisconnection sets the ability to sense client disconnections.
// If we don't set it, it will default to false.
// There are three issues to note when using this option:
// 1. It only applies to netpoll.
// 2. It needs to be used in conjunction with WithOnAccept.
// Examples:
// 1. It only applies to netpoll.
// 2. It needs to be used in conjunction with WithOnAccept.
// Examples:
// server.Default(
// server.WithSenseClientDisconnection(true),
// server.WithOnConnect(func(ctx context.Context, conn network.Conn) context.Context {
// return ctx
// }))
// 3. The cost is high after opening, please choose carefully.
// server.WithSenseClientDisconnection(true),
// server.WithOnConnect(func(ctx context.Context, conn network.Conn) context.Context {
// return ctx
// }))
// 3. The cost is high after opening, please choose carefully.
func WithSenseClientDisconnection(b bool) config.Option {
return config.Option{F: func(o *config.Options) {
o.SenseClientDisconnection = b
Expand Down

0 comments on commit dee4aaa

Please sign in to comment.