From 855dc0edb7a83dc950d6651d2ad3d8e7a66f9241 Mon Sep 17 00:00:00 2001 From: Carlos Nihelton Date: Wed, 13 Sep 2023 09:44:03 -0300 Subject: [PATCH] Simplify passing settings from main @EduardGomezEscandell showed that the passing a pointer to the defaultSettings was the cause of the double star in serverFactory --- mocks/contractserver/contracts/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mocks/contractserver/contracts/main.go b/mocks/contractserver/contracts/main.go index bfaca9d4d..41bfac5e3 100644 --- a/mocks/contractserver/contracts/main.go +++ b/mocks/contractserver/contracts/main.go @@ -10,16 +10,14 @@ import ( func serverFactory(settings restserver.Settings) restserver.Server { //nolint:forcetypeassert // Let the type coersion panic on failure. - return contractsmockserver.NewServer(*settings.(*contractsmockserver.Settings)) + return contractsmockserver.NewServer(settings.(contractsmockserver.Settings)) } func main() { - defaultSettings := contractsmockserver.DefaultSettings() - app := restserver.App{ Name: "contract server", Description: "contract server", - DefaultSettings: &defaultSettings, + DefaultSettings: contractsmockserver.DefaultSettings(), ServerFactory: serverFactory, }