Skip to content

Commit

Permalink
调整代码
Browse files Browse the repository at this point in the history
  • Loading branch information
FishGoddess committed Dec 12, 2023
1 parent accedcc commit f9e7c3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestConfigNewHandlerOptions(t *testing.T) {
// go test -v -cover -count=1 -test.cpu=1 -run=^TestConfigNewHandler$
func TestConfigNewHandler(t *testing.T) {
handlerName := t.Name()

RegisterHandler(handlerName, func(w io.Writer, opts *slog.HandlerOptions) slog.Handler {
return &testConfigHandler{
w: w,
Expand Down
4 changes: 2 additions & 2 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ func WithHandler(handler string) Option {
// WithTextHandler sets text handler to config.
func WithTextHandler() Option {
return func(conf *config) {
conf.handler = "text"
conf.handler = handlerText
}
}

// WithJsonHandler sets json handler to config.
func WithJsonHandler() Option {
return func(conf *config) {
conf.handler = "json"
conf.handler = handlerJson
}
}

Expand Down

0 comments on commit f9e7c3e

Please sign in to comment.