Skip to content

Commit e8e7f80

Browse files
committed
Make parseAPTConfigLine public
We already have a way to go from a repository to a line, via `Repository.APTConfigLine`. There is a valid usecase to have the reverse, go from a line to a Repository: for instance some software will expect such a line as input/output (Ansible's apt_repository's repo for instance). Given that it's unlikely that the implementation of it will see breaking changes, I don't see any reason to keep it private.
1 parent 0d7233b commit e8e7f80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

repos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (r *Repository) APTConfigLine() string {
107107

108108
var aptConfigLineRegexp = regexp.MustCompile(`^(# )?(deb|deb-src)(?: \[(.*)\])? ([^ ]+) ([^ ]+) ([^#\n]+)(?: +# *(.*))?$`)
109109

110-
func parseAPTConfigLine(line string) *Repository {
110+
func ParseAPTConfigLine(line string) *Repository {
111111
match := aptConfigLineRegexp.FindAllStringSubmatch(line, -1)
112112
if len(match) == 0 || len(match[0]) < 6 {
113113
return nil

0 commit comments

Comments
 (0)