- init
continuous-integration/drone/push Build is passing Details

master
李光春 2 years ago
commit 1ad48c6266

@ -0,0 +1,12 @@
kind: pipeline
type: docker
name: clone
steps:
- name: Test
image: golang:1.18
commands:
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
- go test -v ./...
- go test -bench=. -benchmem

8
.gitignore vendored

@ -0,0 +1,8 @@
.env
.git
.svn
.idea
.vscode
*.log
gomod.sh
/vendor/

@ -0,0 +1,3 @@
module go.dtapp.net/goarray
go 1.18

@ -0,0 +1,18 @@
package goarray
func Grouping() {
}
// TurnString []string 转 string
func TurnString(ss []string) (s string) {
sl := len(ss)
for k, v := range ss {
if k+1 == sl {
s = s + v
} else {
s = s + v + ","
}
}
return s
}

@ -0,0 +1,13 @@
package goarray
import "testing"
func TestTurnString(t *testing.T) {
t.Log(TurnString([]string{"111", "222", "333"}))
}
func BenchmarkTurnString(b *testing.B) {
for i := 0; i < b.N; i++ {
b.Log(TurnString([]string{"111", "222", "333"}))
}
}

@ -0,0 +1,3 @@
package goarray
const Version = "1.0.0"

@ -0,0 +1,7 @@
package goarray
import "testing"
func TestVersion(t *testing.T) {
t.Log(Version)
}
Loading…
Cancel
Save