chore: remove dead code and unused abstractions (#31437)

This commit is contained in:
andig 2026-07-05 10:03:23 +02:00 • committed by GitHub
parent f0bc3e4ddf
commit 67f7f286ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 35 additions and 470 deletions

View file

@ -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
}

View file

@ -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

View file

@ -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
}