aboutsummaryrefslogtreecommitdiffstats
path: root/src/c_utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_utils.go')
-rw-r--r--src/c_utils.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/c_utils.go b/src/c_utils.go
index 2aa3fec..8d95a77 100644
--- a/src/c_utils.go
+++ b/src/c_utils.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/c_utils.go
- * Mon Jan 29 08:56:55 2024
+ * Thu May 16 09:48:25 2024
* Joe
*
* core funcs
@@ -220,3 +220,15 @@ func c_get_secret_gpg_keyring() [][2]string {
keys = append(keys, [2]string{"plain", ""})
return keys
}
+
+// reverses a string
+// can be useful somehow
+// found here really thanks yazu:
+// https://stackoverflow.com/questions/1752414/how-to-reverse-a-string-in-go
+func c_reverse_string(str string) string {
+ runes := []rune(str)
+ for i, j := 0, len(runes) - 1; i < j; i, j = i + 1, j - 1 {
+ runes[i], runes[j] = runes[j], runes[i]
+ }
+ return string(runes)
+}