package codeowners
import "github.com/hairyhenderson/go-codeowners"
Index ¶
- type Codeowner
- func NewCodeowner(pattern string, owners []string) (Codeowner, error)
- func (c Codeowner) String() string
- type Codeowners
Examples ¶
Types ¶
type Codeowner ¶
type Codeowner struct {
// contains filtered or unexported fields
}
Codeowner - owners for a given pattern
func NewCodeowner ¶
NewCodeowner -
func (Codeowner) String ¶
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 -
Code:
Output:Example¶
{
c, _ := NewCodeowners(cwd())
fmt.Println(c.patterns[0])
// Output:
// ** @hairyhenderson
}
** @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)
Code:
Output: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
}
Owner #0 is @hairyhenderson
Source Files ¶
- Version
- v0.1.0
- Published
- Feb 13, 2020
- Platform
- darwin/amd64
- Imports
- 10 packages
- Last checked
- now –
Tools for package owners.