From cdbc8787eac86dd9abb81a0ee7b46dad0f6ff774 Mon Sep 17 00:00:00 2001 From: vernonr3 <12446343+vernonr3@users.noreply.github.com> Date: Thu, 23 Mar 2023 15:13:17 +0000 Subject: [PATCH] Change to stop crash on compile and run of example. Change line 15 in example/main.go to take the address of the structure. This was being caught on line 11 of checker.go where the value is checked to ensure it is a pointer. This make the example work again. Suspect that the rule validation was changed after the example was constructed. --- example/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/main.go b/example/main.go index c787b7b..566fa68 100644 --- a/example/main.go +++ b/example/main.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "fmt" + "github.com/rendis/structsconv" "github.com/rendis/structsconv/example/domain" "github.com/rendis/structsconv/example/dto" @@ -11,7 +12,7 @@ import ( func main() { structsconv.RegisterRulesDefinitions(rules.GetUserInfoDtoToUserInfoDomainRules()) - structsconv.RegisterSetOfRulesDefinitions(rules.RulesDefinitions{}) + structsconv.RegisterSetOfRulesDefinitions(&rules.RulesDefinitions{}) var uDto = &dto.UserDto{ UserID: 15369764,