It seems that clients of this package frequently need to parse GitHub URLs in order to validate and/or extract useful information from them. It would be nice to have all this code deduplicated into a single, central location, and this package might be a nice home for it.
Maybe something like:
func ParseURL(url string) (owner, repo, ref string, err error) {...}
Common URLs to parse could be ones similar to:
https://github.com/bazelbuild/bazel/tree/master
https://github.com/bazelbuild/bazel/tree/master
https://www.github.com/bazelbuild/bazel/tree/master
https://github.com/bazelbuild/bazel/releases/tag/0.2.1
https://github.com/bazelbuild/bazel/commit/19b5675725caf69008a717082149237400260edc
https://github.com/bazelbuild/bazel/archive/0.2.1.zip
Thoughts?
It seems that clients of this package frequently need to parse GitHub URLs in order to validate and/or extract useful information from them. It would be nice to have all this code deduplicated into a single, central location, and this package might be a nice home for it.
Maybe something like:
Common URLs to parse could be ones similar to:
Thoughts?