fix indirection
This commit is contained in:
@ -95,6 +95,7 @@ func NewMaterialMap(path string, logger zerolog.Logger) (MaterialMap, error) {
|
||||
|
||||
toReplace := item2.(map[string]interface{})["material_flags"]
|
||||
|
||||
//todo generalize
|
||||
if ref, ok := toReplace.(map[string]interface{})["$ref"]; ok {
|
||||
rfs := strings.Split(ref.(string), "/")
|
||||
referredFlag := rfs[len(rfs)-1]
|
||||
@ -104,7 +105,7 @@ func NewMaterialMap(path string, logger zerolog.Logger) (MaterialMap, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Could not marshal back:%w", err)
|
||||
}
|
||||
mm[clause] = &Material{}
|
||||
mm[clause] = &Material{Id: clause}
|
||||
err = json.Unmarshal(bts, mm[clause])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Could not unmarshal to material_flags:%w", err)
|
||||
|
Reference in New Issue
Block a user