Preliminary Commit with fixes
- Sorted imports - Fixed nested if block - Added special nolint (goerr113) argument for error initialization - Edited port in main.go - Deleted swagger.json
This commit is contained in:
1 parent
9092acc8bf
commit
abd54bf180
8 files changed
+32
-274
No files matched your search
+13
-13
@@ -92,25 +92,25 @@ func expandArrayWithMapping(
|
||||
arrayPath, typeFieldPath, dstKey string,
|
||||
mapping map[string]string,
|
||||
) {
|
||||
var documents map[string][]interface{}
|
||||
docs, err := src.ArrayOfObjects(arrayPath)
|
||||
l := len(docs)
|
||||
//nolint
|
||||
if err == nil && l > 0 {
|
||||
documents := make(map[string][]interface{}, l)
|
||||
documents = make(map[string][]interface{}, l)
|
||||
for _, d := range docs {
|
||||
if docType, ok := d[typeFieldPath]; ok {
|
||||
if docTypeStr, ok := docType.(string); ok {
|
||||
if v, ok := mapping[docTypeStr]; ok {
|
||||
putDoc(documents, v, d)
|
||||
} else if v, ok := mapping[allOtherValues]; ok {
|
||||
putDoc(documents, v, d)
|
||||
}
|
||||
}
|
||||
if docType, ok := d[typeFieldPath]; !ok {
|
||||
continue
|
||||
} else if docTypeStr, ok := docType.(string); !ok {
|
||||
continue
|
||||
} else if v, ok := mapping[docTypeStr]; !ok {
|
||||
putDoc(documents, v, d)
|
||||
} else if v, ok := mapping[allOtherValues]; !ok {
|
||||
putDoc(documents, v, d)
|
||||
}
|
||||
}
|
||||
if len(documents) > 0 {
|
||||
dst[dstKey] = documents
|
||||
}
|
||||
}
|
||||
if len(documents) > 0 {
|
||||
dst[dstKey] = documents
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user