Skip to content

Commit

Permalink
Simplify passing settings from main
Browse files Browse the repository at this point in the history
@EduardGomezEscandell showed that the passing a pointer
to the defaultSettings was the cause of the double star in serverFactory
  • Loading branch information
CarlosNihelton committed Sep 13, 2023
1 parent 5062220 commit 855dc0e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mocks/contractserver/contracts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit 855dc0e

Please sign in to comment.