aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler/testdata/string.go
blob: 2c37df458e443dc04905ba54739e91d286f4dbb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main

func someString() string {
	return "foo"
}

func zeroLengthString() string {
	return ""
}

func stringLen(s string) int {
	return len(s)
}

func stringIndex(s string, index int) byte {
	return s[index]
}

func stringCompareEqual(s1, s2 string) bool {
	return s1 == s2
}

func stringCompareUnequal(s1, s2 string) bool {
	return s1 != s2
}

func stringCompareLarger(s1, s2 string) bool {
	return s1 > s2
}