Bladeren bron

update

tags/v0.1.0
DengBiao 2 jaren geleden
bovenliggende
commit
2ae6b2974e
8 gewijzigde bestanden met toevoegingen van 62 en 0 verwijderingen
  1. +8
    -0
      .idea/.gitignore
  2. +8
    -0
      .idea/modules.xml
  3. +6
    -0
      .idea/vcs.xml
  4. +9
    -0
      .idea/zyos_go_pay.iml
  5. +0
    -0
     
  6. +3
    -0
      go.mod
  7. +10
    -0
      stringutil/reverse.go
  8. +18
    -0
      stringutil/reverse_test.go

+ 8
- 0
.idea/.gitignore Bestand weergeven

@@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 数据源本地存储已忽略文件
/dataSources/
/dataSources.local.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

+ 8
- 0
.idea/modules.xml Bestand weergeven

@@ -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>

+ 6
- 0
.idea/vcs.xml Bestand weergeven

@@ -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>

+ 9
- 0
.idea/zyos_go_pay.iml Bestand weergeven

@@ -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>


+ 3
- 0
go.mod Bestand weergeven

@@ -0,0 +1,3 @@
module code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git

go 1.16

+ 10
- 0
stringutil/reverse.go Bestand weergeven

@@ -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)
}

+ 18
- 0
stringutil/reverse_test.go Bestand weergeven

@@ -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)
}
}
}

Laden…
Annuleren
Opslaan