See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): [<task code>] <subject>
<scope>
is optional.
[<task code>]
for your task or ticket software like Jira.
func Normalize(text string) string { | |
rgTable := rangetable.Merge(unicode.Mn, unicode.P) | |
t := transform.Chain(norm.NFD, runes.Remove(runes.In(rgTable)), norm.NFC) | |
text, _, err := transform.String(t, text) | |
if err != nil { | |
log.WithError(err).Error("Error normalizing text") | |
return internalNormalize(text) |
** Avoid having to create a script to delete a set of Redis keys, do it from your terminal **
Since the Redis client does not have a native function to delete keys given a pattern or expression, it is usually customary to use the KEYS function that allows bringing all the keys that match a pattern and later these keys are traversed and the deletion is executed, but Normally you require a script that is the one that does these operations without being able to do it from the native redis client.
In this snippet we take advantage of one of the advantages of Redis as of version 2.6.0, which is the ability to execute Lua scripts Through the EVAL command, allowing us to delete redis keys from our terminal as if we were using the DEL command but for a pattern that we want.