Go

Go

Made by DeepSource

Simplify regular expression by using raw string literal SCC-S1007

Anti-pattern
Major
Autofix

Raw string literals use backticks (`) instead of quotes (") and thus, do not support any escape sequences. This means that the backslash (\) can be used freely, without escaping.

Since regular expressions have their escape sequences, raw strings can improve their readability.

Bad practice

regexp.Compile("\\A(\\w+) profile: total \\d+\\n\\z")

Recommended

regexp.Compile(`\A(\w+) profile: total \d+
\z`)