commit
3601ccf4f5
@ -0,0 +1,17 @@
|
|||||||
|
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 ./...
|
||||||
|
- name: Benchmark
|
||||||
|
image: golang:1.18
|
||||||
|
commands:
|
||||||
|
- go env -w GO111MODULE=on
|
||||||
|
- go env -w GOPROXY=https://goproxy.cn,direct
|
||||||
|
- go test -bench=. -benchmem
|
@ -0,0 +1,9 @@
|
|||||||
|
.env
|
||||||
|
.git
|
||||||
|
.svn
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.log
|
||||||
|
goinit.sh
|
||||||
|
gomod.sh
|
||||||
|
/vendor/
|
@ -0,0 +1,16 @@
|
|||||||
|
package goint
|
||||||
|
|
||||||
|
import (
|
||||||
|
"math"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ToString int到string
|
||||||
|
func ToString(n int) string {
|
||||||
|
return strconv.Itoa(n)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ToFloat64 int到float64
|
||||||
|
func ToFloat64(n int) float64 {
|
||||||
|
return float64(n) / math.Pow10(0)
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package goint
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestToString(t *testing.T) {
|
||||||
|
t.Log(ToString(9898))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestToFloat64(t *testing.T) {
|
||||||
|
t.Log(ToFloat64(9898))
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
package goint
|
||||||
|
|
||||||
|
const Version = "1.0.0"
|
@ -0,0 +1,7 @@
|
|||||||
|
package goint
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestVersion(t *testing.T) {
|
||||||
|
t.Log(Version)
|
||||||
|
}
|
Loading…
Reference in new issue