Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codeowner ¶
type Codeowner struct {
// contains filtered or unexported fields
}
Codeowner - owners for a given pattern
func NewCodeowner ¶
NewCodeowner -
type Codeowners ¶
type Codeowners struct {
// contains filtered or unexported fields
}
Codeowners - patterns/owners mappings for the given repo
func NewCodeowners ¶
func NewCodeowners(path string) (*Codeowners, error)
NewCodeowners -
Example ¶
c, _ := NewCodeowners(cwd()) fmt.Println(c.patterns[0])
Output: * @hairyhenderson
func (*Codeowners) Owners ¶
func (c *Codeowners) Owners(path string) []string
Owners - return the list of code owners for the given path (within the repo root)
Example ¶
c, _ := NewCodeowners(cwd())
owners := c.Owners("README.md")
for i, o := range owners {
fmt.Printf("Owner #%d is %s\n", i, o)
}
Output: Owner #0 is @hairyhenderson
Click to show internal directories.
Click to hide internal directories.