Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
fix bug when vendoring and no mod file
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Apr 12, 2020
1 parent 245b7b3 commit 8ce9716
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/modder/modder_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func (mdr *Modder) WriteVendor() error {
Path: strings.Join([]string{m.Module}, "/"),
Version: m.Version,
}
if mdr.module.SumFile == nil {
mdr.module.SumFile = &sumfile.Sum{}
}
mdr.module.SumFile.Add(dver, dirhash)

mver := sumfile.Version{
Expand Down
3 changes: 3 additions & 0 deletions lib/parse/sumfile/sumfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func ParseSum(data []byte, file string) (Sum, error) {
}

func (sum *Sum) Add(ver Version, hash string) {
if sum.Mods == nil {
sum.Mods = make(map[Version][]string)
}
val, ok := sum.Mods[ver]
if !ok {
val = make([]string,0)
Expand Down

0 comments on commit 8ce9716

Please sign in to comment.