- init
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
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
|
@ -0,0 +1,8 @@
|
|||||||
|
.env
|
||||||
|
.git
|
||||||
|
.svn
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.log
|
||||||
|
gomod.sh
|
||||||
|
/vendor/
|
@ -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…
Reference in new issue