diff --git a/cmd/usecasevalidator/main.go b/cmd/usecasevalidator/main.go index e11d93692..72be0837a 100644 --- a/cmd/usecasevalidator/main.go +++ b/cmd/usecasevalidator/main.go @@ -416,14 +416,14 @@ func listObjects(info *useCaseInfo) { fmt.Println("\n- Types:") fmt.Println() for id, key := range info.types { - obj, _ := info.objects[id] + obj := info.objects[id] fmt.Printf("%s:\t%24s - %s\n", id[len(id)-4:], key, obj.Name) } fmt.Println("\n- Relations:") fmt.Println() for id, key := range info.relations { - obj, _ := info.objects[id] + obj := info.objects[id] fmt.Printf("%s:\t%24s - %s\n", id[len(id)-4:], key, obj.Name) } } diff --git a/cmd/usecasevalidator/rules.go b/cmd/usecasevalidator/rules.go index 9f28d37c4..2ffe65ee4 100644 --- a/cmd/usecasevalidator/rules.go +++ b/cmd/usecasevalidator/rules.go @@ -80,22 +80,22 @@ func processRules(s *pb.ChangeSnapshot) { switch r.Entity { case relationLink: - doRelationLinkRule(s, &r) + doRelationLinkRule(s, r) case detail: - doDetailRule(s, &r) + doDetailRule(s, r) case objectType: - doObjectTypeRule(s, &r) + doObjectTypeRule(s, r) case dataViewTarget: - doDataViewTargetRule(s, &r) + doDataViewTargetRule(s, r) case linkTarget: - doLinkTargetRule(s, &r) + doLinkTargetRule(s, r) default: fmt.Println("Invalid entity in rule", i, ":", r.Entity) } } } -func doRelationLinkRule(s *pb.ChangeSnapshot, r *rule) { +func doRelationLinkRule(s *pb.ChangeSnapshot, r rule) { if r.RelationLink == nil || r.RelationLink.Key == "" { fmt.Println("Invalid Relation link provided in relation-rule") return @@ -116,7 +116,7 @@ func doRelationLinkRule(s *pb.ChangeSnapshot, r *rule) { } } -func doDetailRule(s *pb.ChangeSnapshot, r *rule) { +func doDetailRule(s *pb.ChangeSnapshot, r rule) { if r.DetailKey == "" { fmt.Println("No detail key provided in detail-rule") return @@ -131,7 +131,7 @@ func doDetailRule(s *pb.ChangeSnapshot, r *rule) { } } -func doObjectTypeRule(s *pb.ChangeSnapshot, r *rule) { +func doObjectTypeRule(s *pb.ChangeSnapshot, r rule) { if r.ObjectType == "" { fmt.Println("No object type provided in objectType-rule") return @@ -148,7 +148,7 @@ func doObjectTypeRule(s *pb.ChangeSnapshot, r *rule) { } } -func doDataViewTargetRule(s *pb.ChangeSnapshot, r *rule) { +func doDataViewTargetRule(s *pb.ChangeSnapshot, r rule) { if r.BlockID == "" { fmt.Println("Block id is not provided for dataViewTarget-rule") return @@ -177,7 +177,7 @@ func doDataViewTargetRule(s *pb.ChangeSnapshot, r *rule) { } } -func doLinkTargetRule(s *pb.ChangeSnapshot, r *rule) { +func doLinkTargetRule(s *pb.ChangeSnapshot, r rule) { if r.BlockID == "" { fmt.Println("Block id is not provided for linkTarget-rule") return diff --git a/cmd/usecasevalidator/validators.go b/cmd/usecasevalidator/validators.go index ab351ec03..31c0784c5 100644 --- a/cmd/usecasevalidator/validators.go +++ b/cmd/usecasevalidator/validators.go @@ -229,11 +229,6 @@ func validateFileKeys(s *pb.SnapshotWithType, _ *useCaseInfo) error { } for _, b := range s.Snapshot.Data.Blocks { if v, ok := simple.New(b).(simple.FileHashes); ok { - //if v, ok := v.(file.Block); ok && v.Model().GetFile().Hash == "" { - // fmt.Printf("file block '%s' of object '%s' has empty hash\n", v.Model().Id, id) - // invalidKeyFound = true - // continue - //} var hashes []string hashes = v.FillFileHashes(hashes) if len(hashes) == 0 {