mirror of
https://github.com/go-eagle/eagle.git
synced 2025-09-26 20:41:26 +08:00
chore(lint): remove error lint
This commit is contained in:
@@ -230,7 +230,7 @@ linters:
|
||||
- dogsled
|
||||
# - dupl
|
||||
- errcheck
|
||||
- gochecknoinits
|
||||
# - gochecknoinits
|
||||
- goconst
|
||||
- gocyclo
|
||||
- gofmt
|
||||
|
@@ -7,6 +7,7 @@ import (
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
)
|
||||
|
||||
// GrpcStatus grpc error
|
||||
type GrpcStatus struct {
|
||||
status *status.Status
|
||||
details []proto.Message
|
||||
@@ -18,6 +19,7 @@ func New(code codes.Code, msg string) *GrpcStatus {
|
||||
}
|
||||
}
|
||||
|
||||
// Status .
|
||||
func (g *GrpcStatus) Status(details ...proto.Message) *status.Status {
|
||||
details = append(details, g.details...)
|
||||
st, err := g.status.WithDetails(details...)
|
||||
@@ -27,11 +29,13 @@ func (g *GrpcStatus) Status(details ...proto.Message) *status.Status {
|
||||
return st
|
||||
}
|
||||
|
||||
// WithDetails .
|
||||
func (g *GrpcStatus) WithDetails(details ...proto.Message) *GrpcStatus {
|
||||
g.details = details
|
||||
return g
|
||||
}
|
||||
|
||||
// NewDetails .
|
||||
func NewDetails(details map[string]interface{}) proto.Message {
|
||||
detailStruct, err := structpb.NewStruct(details)
|
||||
if err != nil {
|
||||
|
@@ -14,7 +14,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
TraceName = "github.com/go-eagle/eagle/trace/plugins/function"
|
||||
// TraceName function trance name
|
||||
TraceName = "github.com/go-eagle/eagle/trace/plugins/function"
|
||||
// PluginName plugin category name
|
||||
PluginName = "function"
|
||||
)
|
||||
|
||||
@@ -24,6 +26,7 @@ func init() {
|
||||
tracer = otel.GetTracerProvider().Tracer(TraceName, trace.WithInstrumentationVersion(contrib.SemVersion()))
|
||||
}
|
||||
|
||||
// StartFromContext create a new context
|
||||
func StartFromContext(ctx context.Context) (context.Context, trace.Span) {
|
||||
var spanAttrs []trace.SpanStartOption
|
||||
|
||||
|
@@ -27,7 +27,7 @@ type Server struct {
|
||||
readTimeout time.Duration
|
||||
writeTimeout time.Duration
|
||||
endpoint *url.URL
|
||||
log log.Logger
|
||||
// log log.Logger
|
||||
}
|
||||
|
||||
// defaultServer return a default config server
|
||||
|
@@ -21,5 +21,4 @@ func TestPrintStackTrace(t *testing.T) {
|
||||
|
||||
panic("throw a panic")
|
||||
})
|
||||
|
||||
}
|
||||
|
@@ -7,8 +7,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// DateTime date time layout
|
||||
DateTime = "2006-01-02 15:04:05"
|
||||
// DateOnly date layout
|
||||
DateOnly = "2006-01-02"
|
||||
// TimeOnly time layout
|
||||
TimeOnly = "15:04:05"
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user