2e85b3cccd
Clustering and matching have been improved along the way. This opens the door for further optimizations while keeping the code readable.
15 lines
243 B
Go
15 lines
243 B
Go
package txt
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// Quote adds quotation marks to a string if needed.
|
|
func Quote(text string) string {
|
|
if text == "" || strings.ContainsAny(text, " \n'\"") {
|
|
return fmt.Sprintf("“%s”", text)
|
|
}
|
|
|
|
return text
|
|
}
|