chore: remove dead code and unused abstractions (#31437)
This commit is contained in:
parent
f0bc3e4ddf
commit
67f7f286ac
16 changed files with 35 additions and 470 deletions
|
|
@ -10,7 +10,7 @@ func WithLogger(ctx context.Context, log *Logger) context.Context {
|
|||
return context.WithValue(ctx, CtxLogger, log)
|
||||
}
|
||||
|
||||
func ContextLogger(ctx context.Context) *Logger {
|
||||
func contextLogger(ctx context.Context) *Logger {
|
||||
if ctx != nil {
|
||||
if l, ok := ctx.Value(CtxLogger).(*Logger); ok {
|
||||
return l
|
||||
|
|
@ -21,7 +21,7 @@ func ContextLogger(ctx context.Context) *Logger {
|
|||
}
|
||||
|
||||
func ContextLoggerWithDefault(ctx context.Context, log *Logger) *Logger {
|
||||
if log := ContextLogger(ctx); log != nil {
|
||||
if log := contextLogger(ctx); log != nil {
|
||||
return log
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,6 @@ import (
|
|||
"github.com/evcc-io/evcc/api"
|
||||
)
|
||||
|
||||
// TeeAttacher allows attaching a listener to a tee
|
||||
type TeeAttacher interface {
|
||||
Attach() <-chan Param
|
||||
}
|
||||
|
||||
// Tee distributes parameters to subscribers
|
||||
type Tee struct {
|
||||
mu sync.Mutex
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package urlvalues
|
|||
import (
|
||||
"errors"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
@ -11,7 +12,7 @@ import (
|
|||
func Copy(q url.Values) url.Values {
|
||||
res := make(url.Values, len(q))
|
||||
for k, v := range q {
|
||||
res[k] = append([]string{}, v...)
|
||||
res[k] = slices.Clone(v)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue