refactor: update memo tags

This commit is contained in:
Steven
2024-05-08 20:03:01 +08:00
parent 2c270438ec
commit d0655ece53
61 changed files with 1815 additions and 2855 deletions

View File

@ -61,3 +61,13 @@ func RandomString(n int) (string, error) {
}
return sb.String(), nil
}
// ReplaceString replaces all occurrences of old in slice with new.
func ReplaceString(slice []string, old, new string) []string {
for i, s := range slice {
if s == old {
slice[i] = new
}
}
return slice
}