add golangci feature to guarantee codes quality (#2229)

This commit is contained in:
houseme
2022-11-01 20:12:21 +08:00
committed by GitHub
parent 8e0e87877a
commit 1793bf0863
255 changed files with 1123 additions and 690 deletions

View File

@ -2,10 +2,11 @@ package main
import (
"github.com/gogf/gf/contrib/trace/jaeger/v2"
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/gtrace"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
)
const (

View File

@ -1,9 +1,8 @@
package user
import (
"google.golang.org/grpc"
"github.com/gogf/katyusha/krpc"
"google.golang.org/grpc"
)
const (

View File

@ -1,19 +1,20 @@
package main
import (
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
"context"
"fmt"
"time"
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
"github.com/gogf/gf/contrib/trace/jaeger/v2"
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcache"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/katyusha/krpc"
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
)
type server struct{}

View File

@ -1,12 +1,12 @@
package main
import (
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
"context"
"fmt"
"time"
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
"github.com/gogf/gf/contrib/trace/jaeger/v2"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
@ -46,6 +46,7 @@ func main() {
type InsertReq struct {
Name string `v:"required#Please input user name."`
}
type InsertRes struct {
Id int64
}
@ -66,6 +67,7 @@ func (c *cTrace) Insert(ctx context.Context, req *InsertReq) (res *InsertRes, er
type QueryReq struct {
Id int `v:"min:1#User id is required for querying"`
}
type QueryRes struct {
User gdb.Record
}
@ -90,6 +92,7 @@ func (c *cTrace) Query(ctx context.Context, req *QueryReq) (res *QueryRes, err e
type DeleteReq struct {
Id int `v:"min:1#User id is required for deleting."`
}
type DeleteRes struct{}
// Delete is a route handler for deleting specified user info.