mirror of
https://github.com/turbot/steampipe.git
synced 2026-01-24 08:01:31 -05:00
--------- Co-authored-by: Binaek Sarkar <binaek@turbot.com> Co-authored-by: Puskar Basu <puskar@turbot.com>
26 lines
717 B
Go
26 lines
717 B
Go
package utils
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// UnquoteStringArray removes quote marks from elements of string array
|
|
func UnquoteStringArray(stringArray []string) []string {
|
|
res := make([]string, len(stringArray))
|
|
for i, s := range stringArray {
|
|
res[i] = strings.ReplaceAll(s, `"`, ``)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// StringSlicesEqual returns whether the 2 string slices are identical
|
|
func StringSlicesEqual(l, r []string) bool {
|
|
return strings.Join(l, ",") == strings.Join(r, ",")
|
|
}
|
|
|
|
// RemoveElementFromSlice takes a slice of strings and an index to remove,
|
|
// and returns a new slice with the specified element removed.
|
|
func RemoveElementFromSlice(slice []string, s int) []string {
|
|
return append(slice[:s], slice[s+1:]...)
|
|
}
|