From 2438d01a021c39bb40767b838bcc5235203616e8 Mon Sep 17 00:00:00 2001 From: Jqs7 <7@jqs7.com> Date: Sat, 27 Apr 2024 17:09:05 +0800 Subject: [PATCH] refactor: refactor API routing and optimize import usage - Removed the `"slices"` import in `container.go` - Changed the `RouteAPI` method to use `append` instead of `slices.Concat` Signed-off-by: Jqs7 <7@jqs7.com> --- container.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/container.go b/container.go index 75a3c32..b1cf5ff 100644 --- a/container.go +++ b/container.go @@ -7,7 +7,6 @@ import ( "net/http/httptest" "os" "reflect" - "slices" "github.com/emicklei/go-restful/v3" "github.com/go-openapi/spec" @@ -226,5 +225,5 @@ func (c *Container) NewWS() WS { } func (c *Container) RouteAPI(f any, opts ...opt.RouteAPIOpts) opt.RouteFunc { - return opt.RouteAPI(f, slices.Concat([]opt.RouteAPIOpts{opt.WithLogger(c.logger)}, opts)...) + return opt.RouteAPI(f, append([]opt.RouteAPIOpts{opt.WithLogger(c.logger)}, opts...)...) }