aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/launchpad/config.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-23 14:23:34 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-23 14:23:34 +0100
commitdc21ad089295723ca95bf1b452d2f6f31c51c735 (patch)
tree396df7da8fc1fbcb8d4edd289c09bfe933c04c68 /bridge/launchpad/config.go
parentb3318335986618388637a9d35d68b39633e4548a (diff)
downloadgit-bug-dc21ad089295723ca95bf1b452d2f6f31c51c735.tar.gz
use regex.MustCompile instead of dealing with the error
Diffstat (limited to 'bridge/launchpad/config.go')
-rw-r--r--bridge/launchpad/config.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/bridge/launchpad/config.go b/bridge/launchpad/config.go
index 8567675f..dfff0d3d 100644
--- a/bridge/launchpad/config.go
+++ b/bridge/launchpad/config.go
@@ -91,10 +91,7 @@ func validateProject(project string) (bool, error) {
// extract project name from url
func splitURL(url string) (string, error) {
- re, err := regexp.Compile(`launchpad\.net[\/:]([^\/]*[a-z]+)`)
- if err != nil {
- panic("regexp compile:" + err.Error())
- }
+ re := regexp.MustCompile(`launchpad\.net[\/:]([^\/]*[a-z]+)`)
res := re.FindStringSubmatch(url)
if res == nil {