tests/thirdparty: multiple packages per project (#262)

This commit is contained in:
Michael McLoughlin
2022-04-24 20:20:11 -07:00
committed by GitHub
parent 96c4d85995
commit 84071ae4f9
14 changed files with 1051 additions and 894 deletions

View File

@@ -32,7 +32,7 @@ var (
typ = flag.String("type", "", "documentation type")
tmpl = flag.String("tmpl", "", "explicit template file (overrides -type)")
output = flag.String("output", "", "path to output file (default stdout)")
pkgsfilename = flag.String("pkgs", "", "packages configuration")
prjsfilename = flag.String("prjs", "", "projects configuration")
)
func mainerr() (err error) {
@@ -57,19 +57,19 @@ func mainerr() (err error) {
return err
}
// Load third-party packages.
if *pkgsfilename == "" {
return errors.New("missing packages configuration")
// Load third-party projects.
if *prjsfilename == "" {
return errors.New("missing projects configuration")
}
pkgs, err := thirdparty.LoadPackagesFile(*pkgsfilename)
prjs, err := thirdparty.LoadProjectsFile(*prjsfilename)
if err != nil {
return err
}
// Execute.
data := map[string]interface{}{
"Packages": pkgs,
"Projects": prjs,
}
var buf bytes.Buffer