aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/config.go b/config.go
index c40b2bd..1699e7f 100644
--- a/config.go
+++ b/config.go
@@ -10,6 +10,7 @@ import (
)
const _defaultGodocServer = "pkg.go.dev"
+const _defaultBranch = "master"
// Config represents the structure of the yaml file
type Config struct {
@@ -22,7 +23,8 @@ type Config struct {
// Package details the options available for each repo
type Package struct {
- Repo string `yaml:"repo"`
+ Repo string `yaml:"repo"`
+ Branch string `yaml:"branch"`
}
// ensureAlphabetical checks that the packages are listed alphabetically in the configuration.
@@ -75,5 +77,13 @@ func Parse(path string) (*Config, error) {
c.Godoc.Host = host
}
+ // set default branch
+ for v, p := range c.Packages {
+ if p.Branch == "" {
+ p.Branch = _defaultBranch
+ c.Packages[v] = p
+ }
+ }
+
return &c, err
}