fix golint issues in core/utils (#520)

* fix golint issues in core/utils

* fix golint issues in core/trace

* fix golint issues in core/trace
This commit is contained in:
Kevin Wan
2021-02-26 16:20:47 +08:00
committed by GitHub
parent 2087ac1e89
commit f309e9f80c
8 changed files with 27 additions and 1 deletions

View File

@@ -7,7 +7,9 @@ import (
)
const (
// HttpFormat means http carrier format.
HttpFormat = iota
// GrpcFormat means grpc carrier format.
GrpcFormat
)
@@ -17,6 +19,7 @@ var (
)
type (
// Propagator interface wraps the Extract and Inject methods.
Propagator interface {
Extract(carrier interface{}) (Carrier, error)
Inject(carrier interface{}) (Carrier, error)
@@ -58,6 +61,7 @@ func (g grpcPropagator) Inject(carrier interface{}) (Carrier, error) {
return nil, ErrInvalidCarrier
}
// Extract extracts tracing information from carrier with given format.
func Extract(format, carrier interface{}) (Carrier, error) {
switch v := format.(type) {
case int:
@@ -71,6 +75,7 @@ func Extract(format, carrier interface{}) (Carrier, error) {
return nil, ErrInvalidCarrier
}
// Inject injects tracing information into carrier with given format.
func Inject(format, carrier interface{}) (Carrier, error) {
switch v := format.(type) {
case int: