1
0
mirror of https://github.com/moby/moby.git synced 2025-08-01 05:47:11 +03:00

integration-cli: use raw strings for regexes (gosimple)

```
14:26:43 integration-cli/docker_cli_build_test.go:3430:15: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
14:26:43 	outRegexp := regexp.MustCompile("^(sha256:|)[a-z0-9]{64}\\n$")
14:26:43 	             ^
14:26:43 integration-cli/docker_cli_by_digest_test.go:26:20: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
14:26:43 	pushDigestRegex = regexp.MustCompile("[\\S]+: digest: ([\\S]+) size: [0-9]+")
14:26:43 	                  ^
14:26:43 integration-cli/docker_cli_by_digest_test.go:27:20: S1007: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
14:26:43 	digestRegex     = regexp.MustCompile("Digest: ([\\S]+)")
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2019-08-05 16:53:46 +02:00
parent fdc1b22030
commit a0d58b2248
5 changed files with 6 additions and 6 deletions

View File

@ -3427,7 +3427,7 @@ func (s *DockerSuite) TestBuildLabelsCache(c *testing.T) {
func (s *DockerSuite) TestBuildNotVerboseSuccess(c *testing.T) {
// This test makes sure that -q works correctly when build is successful:
// stdout has only the image ID (long image ID) and stderr is empty.
outRegexp := regexp.MustCompile("^(sha256:|)[a-z0-9]{64}\\n$")
outRegexp := regexp.MustCompile(`^(sha256:|)[a-z0-9]{64}\n$`)
buildFlags := cli.WithFlags("-q")
tt := []struct {