@@ -0,0 +1,8 @@ | |||||
# 默认忽略的文件 | |||||
/shelf/ | |||||
/workspace.xml | |||||
# 数据源本地存储已忽略文件 | |||||
/dataSources/ | |||||
/dataSources.local.xml | |||||
# 基于编辑器的 HTTP 客户端请求 | |||||
/httpRequests/ |
@@ -0,0 +1,8 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<project version="4"> | |||||
<component name="ProjectModuleManager"> | |||||
<modules> | |||||
<module fileurl="file://$PROJECT_DIR$/.idea/zyos_go_pay.iml" filepath="$PROJECT_DIR$/.idea/zyos_go_pay.iml" /> | |||||
</modules> | |||||
</component> | |||||
</project> |
@@ -0,0 +1,6 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<project version="4"> | |||||
<component name="VcsDirectoryMappings"> | |||||
<mapping directory="$PROJECT_DIR$" vcs="Git" /> | |||||
</component> | |||||
</project> |
@@ -0,0 +1,9 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<module type="WEB_MODULE" version="4"> | |||||
<component name="Go" enabled="true" /> | |||||
<component name="NewModuleRootManager"> | |||||
<content url="file://$MODULE_DIR$" /> | |||||
<orderEntry type="inheritedJdk" /> | |||||
<orderEntry type="sourceFolder" forTests="false" /> | |||||
</component> | |||||
</module> |
@@ -0,0 +1,3 @@ | |||||
module code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git | |||||
go 1.16 |
@@ -0,0 +1,10 @@ | |||||
package stringutil | |||||
// Reverse returns its argument string reversed rune-wise left to right. | |||||
func Reverse(s string) string { | |||||
r := []rune(s) | |||||
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { | |||||
r[i], r[j] = r[j], r[i] | |||||
} | |||||
return string(r) | |||||
} |
@@ -0,0 +1,18 @@ | |||||
package stringutil | |||||
import "testing" | |||||
func TestReverse(t *testing.T) { | |||||
for _, c := range []struct { | |||||
in, want string | |||||
}{ | |||||
{"Hello, world", "dlrow ,olleH"}, | |||||
{"Hello, 世界", "界世 ,olleH"}, | |||||
{"", ""}, | |||||
} { | |||||
got := Reverse(c.in) | |||||
if got != c.want { | |||||
t.Errorf("Reverse(%q) == %q, want %q", c.in, got, c.want) | |||||
} | |||||
} | |||||
} |