Skip to content

Instantly share code, notes, and snippets.

@asyncins
Created June 24, 2020 03:03
Show Gist options
  • Save asyncins/3db7397c08f81447bde6454be2cc3caa to your computer and use it in GitHub Desktop.
Save asyncins/3db7397c08f81447bde6454be2cc3caa to your computer and use it in GitHub Desktop.
[Golang 两个数组是否完全相等]
/* 判断两个数组是否相同 */
func ArrayEqual(a, b []string) bool {
if (a == nil) != (b == nil) {
return false
}
if len(a) != len(b) {
return false
}
for key, val := range a {
if val != b[key] {
return false
}
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment