pin repos error message enhancement
package main
import (
- "github.com/solo-io/go-utils/versionutils"
+ version "github.com/solo-io/go-utils/versionutils"
"github.com/solo-io/solo-kit/pkg/utils/log"
)
func main() {
tomlTree, err := version.ParseToml()
- if err != nil {
- fatal(err)
- }
+ fatalCheck(err, "parsing error")
soloKitVersion, err := version.GetVersion(version.SoloKitPkg, tomlTree)
- if err != nil {
- fatal(err)
+ fatalCheck(err, "getting solo-kit version")
+
+ fatalCheck(version.PinGitVersion("../solo-kit", soloKitVersion), "consider git fetching in solo-kit repo")
}
- err = version.PinGitVersion("../solo-kit", soloKitVersion)
+
+func fatalCheck(err error, msg string) {
if err != nil {
- fatal(err)
- }
+ log.Fatalf("Error (%v) unable to pin repos!: %v", msg, err)
}
-
-func fatal(err error) {
- log.Fatalf("unable to pin repos!: %v", err)
}
