From dc21ad089295723ca95bf1b452d2f6f31c51c735 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 23 Feb 2020 14:23:34 +0100 Subject: use regex.MustCompile instead of dealing with the error --- bridge/launchpad/config.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'bridge/launchpad') 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 { -- cgit