// Case 1: There's a '\' just before the '@' sign -> Should it be escaped (aka be a literal '@')?
ifstrings.HasSuffix(it,"\\")&&i!=len(split)-1{
// Case 1.1: Escaped backslash
ifstrings.HasSuffix(it,"\\\\"){
it=strings.TrimSuffix(it,"\\")
log.Warnf("The part '%s' of the flag input '%s' ends with a double backslash, so we assume you want to escape the backslash before the '@'. That's the only time we do this.",it,flag)
}else{
// Case 1.2: Unescaped backslash -> Escaping the '@' -> remove suffix and append it to buffer, followed by the escaped @ sign
log.Tracef("Item '%s' just before an '@' ends with '\\', so we assume it's escaping a literal '@'",it)
buffer+=strings.TrimSuffix(it,"\\")+"@"
continue
}
}
// Case 2: There's no '\': append item to buffer, save it to new slice, empty buffer and continue