Where is Go's string == function (the function which gets called when you write if a == "a" {}
) sources?
评论:
Bake_Jailey:
You're looking for
runtime·cmpstring
.In plain Go, here: https://github.com/golang/go/blob/master/src/internal/bytealg/compare_generic.go
But many common architectures have specific implementations in assembly, like: https://github.com/golang/go/blob/master/src/internal/bytealg/compare_amd64.s
