Merge pull request #1064 from zabio3/using-rawstring-regex
Simplify regular expression by using raw string literaldocker-19.03
commit
21034f4234
|
@ -50,8 +50,8 @@ const (
|
|||
keyContextSubDir = "contextsubdir"
|
||||
)
|
||||
|
||||
var httpPrefix = regexp.MustCompile("^https?://")
|
||||
var gitUrlPathWithFragmentSuffix = regexp.MustCompile("\\.git(?:#.+)?$")
|
||||
var httpPrefix = regexp.MustCompile(`^https?://`)
|
||||
var gitUrlPathWithFragmentSuffix = regexp.MustCompile(`\.git(?:#.+)?$`)
|
||||
|
||||
func Build(ctx context.Context, c client.Client) (*client.Result, error) {
|
||||
opts := c.BuildOpts().Opts
|
||||
|
|
|
@ -79,7 +79,7 @@ http:
|
|||
}
|
||||
|
||||
func detectPort(ctx context.Context, rc io.ReadCloser) (string, error) {
|
||||
r := regexp.MustCompile("listening on 127\\.0\\.0\\.1:(\\d+)")
|
||||
r := regexp.MustCompile(`listening on 127\.0\.0\.1:(\d+)`)
|
||||
s := bufio.NewScanner(rc)
|
||||
found := make(chan struct{})
|
||||
defer func() {
|
||||
|
|
Loading…
Reference in New Issue