format import

master
kevin 4 years ago
parent bae66c49c2
commit 95a9dabf8b

@ -29,7 +29,7 @@ func main() {
store := redis.NewRedis(*rdx, *rdxType, *rdxPass) store := redis.NewRedis(*rdx, *rdxType, *rdxPass)
fmt.Println(store.Ping()) fmt.Println(store.Ping())
lmt := limit.NewPeriodLimit(seconds+1, 5, store, *rdxKey) lmt := limit.NewPeriodLimit(seconds, 5, store, *rdxKey)
timer := time.NewTimer(time.Second * seconds) timer := time.NewTimer(time.Second * seconds)
quit := make(chan struct{}) quit := make(chan struct{})
defer timer.Stop() defer timer.Stop()
@ -41,8 +41,8 @@ func main() {
var allowed, denied int32 var allowed, denied int32
var wait sync.WaitGroup var wait sync.WaitGroup
for i := 0; i < *threads; i++ { for i := 0; i < *threads; i++ {
wait.Add(1)
i := i i := i
wait.Add(1)
go func() { go func() {
for { for {
select { select {

@ -12,13 +12,12 @@ import (
"time" "time"
"github.com/logrusorgru/aurora" "github.com/logrusorgru/aurora"
"github.com/urfave/cli"
"github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/core/logx"
apiformat "github.com/tal-tech/go-zero/tools/goctl/api/format" apiformat "github.com/tal-tech/go-zero/tools/goctl/api/format"
"github.com/tal-tech/go-zero/tools/goctl/api/parser" "github.com/tal-tech/go-zero/tools/goctl/api/parser"
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util" apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
"github.com/tal-tech/go-zero/tools/goctl/util" "github.com/tal-tech/go-zero/tools/goctl/util"
"github.com/urfave/cli"
) )
const tmpFile = "%s-%d" const tmpFile = "%s-%d"

Loading…
Cancel
Save