2024-11-27 21:40:06 -06:00
|
|
|
package gitpb
|
|
|
|
|
|
|
|
import (
|
2024-12-18 23:06:27 -06:00
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"go.wit.com/log"
|
2024-11-27 21:40:06 -06:00
|
|
|
)
|
|
|
|
|
2024-12-18 23:06:27 -06:00
|
|
|
// does processing on the go.mod and go.sum files
|
|
|
|
|
2024-12-15 12:14:48 -06:00
|
|
|
// checks to see if the go.sum and go.mod files exist
|
|
|
|
// also check for a match with the repo.pb GoPrimitive bool
|
|
|
|
// todo: check mtime
|
2024-12-13 00:19:33 -06:00
|
|
|
func (repo *Repo) ValidGoSum() error {
|
2024-12-18 23:06:27 -06:00
|
|
|
if repo.ParseGoSum() {
|
2024-12-15 12:14:48 -06:00
|
|
|
return nil
|
2024-11-27 21:40:06 -06:00
|
|
|
}
|
2024-12-18 23:06:27 -06:00
|
|
|
log.Info("ValidGoSum() deprecated")
|
|
|
|
return fmt.Errorf("ParseGoSum() failed")
|
2024-11-27 21:40:06 -06:00
|
|
|
}
|
|
|
|
|
2024-12-01 15:10:55 -06:00
|
|
|
func (repo *Repo) GoDepsLen() int {
|
|
|
|
if repo.GoDeps == nil {
|
|
|
|
return 0
|
|
|
|
}
|
2024-12-13 00:19:33 -06:00
|
|
|
return len(repo.GoDeps.GoDeps)
|
2024-12-01 15:10:55 -06:00
|
|
|
}
|