Move string type to runtime in separate file

This commit is contained in:
Ayke van Laethem
2018-08-29 20:55:09 +02:00
parent bf160d096b
commit 8f7db8661b
3 changed files with 23 additions and 19 deletions
+20
View File
@@ -0,0 +1,20 @@
package runtime
// This file implements functions related to Go strings.
type _string struct {
length lenType
ptr *uint8
}
func stringEqual(x, y string) bool {
if len(x) != len(y) {
return false
}
for i := 0; i < len(x); i++ {
if x[i] != y[i] {
return false
}
}
return true
}