From 754209c8c55c1c8fb5d61db8a740dadea1569402 Mon Sep 17 00:00:00 2001 From: Carlos Nihelton Date: Wed, 13 Sep 2023 09:41:48 -0300 Subject: [PATCH] Simplify passing Settings in main @EduardGomezEscandell showed that passing the pointer to defaultSettings was the reason for the double star in serverFactory. --- mocks/storeserver/storeserver/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mocks/storeserver/storeserver/main.go b/mocks/storeserver/storeserver/main.go index 71fbb54f5..348e13534 100644 --- a/mocks/storeserver/storeserver/main.go +++ b/mocks/storeserver/storeserver/main.go @@ -10,16 +10,14 @@ import ( func serverFactory(settings restserver.Settings) restserver.Server { //nolint:forcetypeassert // Let the type coersion panic on failure. - return storemockserver.NewServer(*settings.(*storemockserver.Settings)) + return storemockserver.NewServer(settings.(storemockserver.Settings)) } func main() { - defaultSettings := storemockserver.DefaultSettings() - app := restserver.App{ Name: "Store Server", Description: "MS Store API", - DefaultSettings: &defaultSettings, + DefaultSettings: storemockserver.DefaultSettings(), ServerFactory: serverFactory, }