From 9bc9149ef949c07674ddb0d642d012796b7ac085 Mon Sep 17 00:00:00 2001 From: Slawomir Dolzycki-Uchto Date: Fri, 17 Jan 2025 13:23:10 +0100 Subject: [PATCH] Update formatting for mistake #11 --- docs/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/index.md b/docs/index.md index 765ed59..5b5d9d0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -229,10 +229,10 @@ type Option func(options *options) error func WithPort(port int) Option { return func(options *options) error { if port < 0 { - return errors.New("port should be positive") - } - options.port = &port - return nil + return errors.New("port should be positive") + } + options.port = &port + return nil } } @@ -251,7 +251,7 @@ func NewServer(addr string, opts ...Option) ( *http.Server, error) { if options.port == nil { port = defaultHTTPPort } else { - if *options.port == 0 { + if *options.port == 0 { port = randomPort() } else { port = *options.port