mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-11 23:50:05 +01:00
refactor: use a map instead of a slice
Packages are unique anyways so it makes sense to use a map to avoid having duplicates. For compatibility reasons custom json (un)marshallers hide this change from the end user
This commit is contained in:
parent
4b6e2d89e9
commit
6e3e7b2fdd
4 changed files with 52 additions and 17 deletions
|
|
@ -66,6 +66,9 @@ func Load(filepath string) (spec.JsonnetFile, error) {
|
|||
if err := json.Unmarshal(bytes, &m); err != nil {
|
||||
return m, errors.Wrap(err, "failed to unmarshal file")
|
||||
}
|
||||
if m.Dependencies == nil {
|
||||
m.Dependencies = make(map[string]spec.Dependency)
|
||||
}
|
||||
|
||||
return m, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue