1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-08 05:47:07 +09:00

GO-2683 Fix lint

This commit is contained in:
kirillston 2024-01-17 21:37:54 +01:00
parent eceab395a5
commit a226fbe351
No known key found for this signature in database
GPG key ID: 88218A7F1109754B
3 changed files with 12 additions and 17 deletions

View file

@ -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)
}
}

View file

@ -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

View file

@ -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 {