diff --git a/hack/benchmark/internal/starter/gateway/vald/vald.go b/hack/benchmark/internal/starter/gateway/vald/vald.go index 6d1e452cb5..c58c219497 100644 --- a/hack/benchmark/internal/starter/gateway/vald/vald.go +++ b/hack/benchmark/internal/starter/gateway/vald/vald.go @@ -35,7 +35,7 @@ func New(opts ...Option) starter.Starter { return srv } -func (s *server) Run(ctx context.Context, tb testing.TB) func() { +func (*server) Run(ctx context.Context, tb testing.TB) func() { tb.Helper() // TODO (@hlts2): Make when divided gateway. diff --git a/internal/client/v1/client/vald/vald.go b/internal/client/v1/client/vald/vald.go index e058f4fb89..1338d9b88b 100644 --- a/internal/client/v1/client/vald/vald.go +++ b/internal/client/v1/client/vald/vald.go @@ -621,15 +621,15 @@ func (c *client) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) ( return res, nil } -func (c *singleClient) Start(ctx context.Context) (<-chan error, error) { +func (*singleClient) Start(ctx context.Context) (<-chan error, error) { return nil, nil } -func (c *singleClient) Stop(ctx context.Context) error { +func (*singleClient) Stop(ctx context.Context) error { return nil } -func (c *singleClient) GRPCClient() grpc.Client { +func (*singleClient) GRPCClient() grpc.Client { return nil } diff --git a/internal/db/kvs/redis/redis_mock.go b/internal/db/kvs/redis/redis_mock.go index d3eda3d2a6..c54efbc1ee 100644 --- a/internal/db/kvs/redis/redis_mock.go +++ b/internal/db/kvs/redis/redis_mock.go @@ -58,19 +58,19 @@ type dummyHook struct { name string } -func (d *dummyHook) BeforeProcess(ctx context.Context, cmd Cmder) (context.Context, error) { +func (*dummyHook) BeforeProcess(ctx context.Context, cmd Cmder) (context.Context, error) { return ctx, nil } -func (d *dummyHook) AfterProcess(ctx context.Context, cmd Cmder) error { +func (*dummyHook) AfterProcess(ctx context.Context, cmd Cmder) error { return nil } -func (d *dummyHook) BeforeProcessPipeline(ctx context.Context, cmds []Cmder) (context.Context, error) { +func (*dummyHook) BeforeProcessPipeline(ctx context.Context, cmds []Cmder) (context.Context, error) { return ctx, nil } -func (d *dummyHook) AfterProcessPipeline(ctx context.Context, cmds []Cmder) error { +func (*dummyHook) AfterProcessPipeline(ctx context.Context, cmds []Cmder) error { return nil } diff --git a/internal/db/nosql/cassandra/cassandra_mock.go b/internal/db/nosql/cassandra/cassandra_mock.go index 2d8b74358a..53bf0f5c5d 100644 --- a/internal/db/nosql/cassandra/cassandra_mock.go +++ b/internal/db/nosql/cassandra/cassandra_mock.go @@ -39,4 +39,4 @@ func (dm *DialerMock) DialContext(ctx context.Context, network, addr string) (ne func (dm *DialerMock) GetDialer() func(ctx context.Context, network, addr string) (net.Conn, error) { return dm.DialContextFunc } -func (dm *DialerMock) StartDialerCache(ctx context.Context) {} +func (*DialerMock) StartDialerCache(ctx context.Context) {} diff --git a/internal/db/nosql/cassandra/conviction.go b/internal/db/nosql/cassandra/conviction.go index 6e0c359cb5..9e4c6ae3fa 100644 --- a/internal/db/nosql/cassandra/conviction.go +++ b/internal/db/nosql/cassandra/conviction.go @@ -30,12 +30,12 @@ func NewConvictionPolicy() gocql.ConvictionPolicy { } // AddFailure implements gocql.ConvictionPolicy interface to handle failure and convicts all hosts. -func (c *convictionPolicy) AddFailure(err error, host *gocql.HostInfo) bool { +func (*convictionPolicy) AddFailure(err error, host *gocql.HostInfo) bool { log.Warn(errors.ErrCassandraHostDownDetected(err, host.String())) return true } // Reset clears the conviction state. -func (c *convictionPolicy) Reset(host *gocql.HostInfo) { +func (*convictionPolicy) Reset(host *gocql.HostInfo) { log.Infof("cassandra host %s reset detected\t%s", host.HostnameAndPort(), host.String()) } diff --git a/internal/io/copy_bench_test.go b/internal/io/copy_bench_test.go index f532f6d2a2..22c5c27212 100644 --- a/internal/io/copy_bench_test.go +++ b/internal/io/copy_bench_test.go @@ -31,7 +31,7 @@ type writer struct { io.Writer } -func (w *writer) Write(p []byte) (n int, err error) { +func (*writer) Write(p []byte) (n int, err error) { return len(p), nil } diff --git a/internal/k8s/metrics/node/node.go b/internal/k8s/metrics/node/node.go index a1844e4c83..ae0f8c1d2f 100644 --- a/internal/k8s/metrics/node/node.go +++ b/internal/k8s/metrics/node/node.go @@ -128,18 +128,18 @@ func (r *reconciler) NewReconciler(ctx context.Context, mgr manager.Manager) rec return r } -func (r *reconciler) For() (client.Object, []builder.ForOption) { +func (*reconciler) For() (client.Object, []builder.ForOption) { // WARN: metrics should be renew // https://github.com/kubernetes/community/blob/main/contributors/design-proposals/instrumentation/resource-metrics-api.md#further-improvements return new(metrics.NodeMetrics), nil } -func (r *reconciler) Owns() (client.Object, []builder.OwnsOption) { +func (*reconciler) Owns() (client.Object, []builder.OwnsOption) { // return new(metrics.PodMetrics) return nil, nil } -func (r *reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { +func (*reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { // return &source.Kind{Type: new(metrics.NodeMetrics)}, &handler.EnqueueRequestForObject{} return nil, nil, nil } diff --git a/internal/k8s/metrics/pod/pod.go b/internal/k8s/metrics/pod/pod.go index f9f324560c..260e2ceee2 100644 --- a/internal/k8s/metrics/pod/pod.go +++ b/internal/k8s/metrics/pod/pod.go @@ -154,18 +154,18 @@ func (r *reconciler) NewReconciler(ctx context.Context, mgr manager.Manager) rec return r } -func (r *reconciler) For() (client.Object, []builder.ForOption) { +func (*reconciler) For() (client.Object, []builder.ForOption) { // WARN: metrics should be renew // https://github.com/kubernetes/community/blob/main/contributors/design-proposals/instrumentation/resource-metrics-api.md#further-improvements return new(metrics.PodMetrics), nil } -func (r *reconciler) Owns() (client.Object, []builder.OwnsOption) { +func (*reconciler) Owns() (client.Object, []builder.OwnsOption) { // return new(metrics.PodMetrics) return nil, nil } -func (r *reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { +func (*reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { // return &source.Kind{Type: new(metrics.PodMetrics)}, &handler.EnqueueRequestForObject{} return nil, nil, nil } diff --git a/internal/k8s/node/node.go b/internal/k8s/node/node.go index 7a792df00c..1018a4e76b 100644 --- a/internal/k8s/node/node.go +++ b/internal/k8s/node/node.go @@ -167,15 +167,15 @@ func (r *reconciler) NewReconciler(ctx context.Context, mgr manager.Manager) rec return r } -func (r *reconciler) For() (client.Object, []builder.ForOption) { +func (*reconciler) For() (client.Object, []builder.ForOption) { return new(corev1.Node), nil } -func (r *reconciler) Owns() (client.Object, []builder.OwnsOption) { +func (*reconciler) Owns() (client.Object, []builder.OwnsOption) { return nil, nil } -func (r *reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { +func (*reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { // return &source.Kind{Type: new(corev1.Node)}, &handler.EnqueueRequestForObject{} return nil, nil, nil } diff --git a/internal/k8s/pod/pod.go b/internal/k8s/pod/pod.go index bb86771794..ab57f0b652 100644 --- a/internal/k8s/pod/pod.go +++ b/internal/k8s/pod/pod.go @@ -181,15 +181,15 @@ func (r *reconciler) NewReconciler(ctx context.Context, mgr manager.Manager) rec return r } -func (r *reconciler) For() (client.Object, []builder.ForOption) { +func (*reconciler) For() (client.Object, []builder.ForOption) { return new(corev1.Pod), nil } -func (r *reconciler) Owns() (client.Object, []builder.OwnsOption) { +func (*reconciler) Owns() (client.Object, []builder.OwnsOption) { return nil, nil } -func (r *reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { +func (*reconciler) Watches() (*source.Kind, handler.EventHandler, []builder.WatchesOption) { // return &source.Kind{Type: new(corev1.Pod)}, &handler.EnqueueRequestForObject{} return nil, nil, nil } diff --git a/internal/log/glg/glg.go b/internal/log/glg/glg.go index b0b1ba3101..2d2f7f7131 100644 --- a/internal/log/glg/glg.go +++ b/internal/log/glg/glg.go @@ -78,7 +78,7 @@ func (l *logger) setLogFormat(fmt format.Format) *logger { return l } -func (l *logger) Close() error { +func (*logger) Close() error { return nil } diff --git a/internal/log/mock/logger.go b/internal/log/mock/logger.go index e97a045349..13df5ca852 100644 --- a/internal/log/mock/logger.go +++ b/internal/log/mock/logger.go @@ -102,6 +102,6 @@ func (l *Logger) Fatald(msg string, details ...interface{}) { l.FatalfFunc(msg, details...) } -func (l *Logger) Close() error { +func (*Logger) Close() error { return nil } diff --git a/internal/net/grpc/logger/logger.go b/internal/net/grpc/logger/logger.go index e01eeb7d8f..23a0ff8b46 100644 --- a/internal/net/grpc/logger/logger.go +++ b/internal/net/grpc/logger/logger.go @@ -44,64 +44,64 @@ func Init() { } // Info prints the debug log to the logger. -func (l *logger) Info(args ...interface{}) { +func (*logger) Info(args ...interface{}) { log.Debug(append([]interface{}{tag}, args...)...) } // Infoln prints the debug log to the logger. -func (l *logger) Infoln(args ...interface{}) { +func (*logger) Infoln(args ...interface{}) { log.Debug(append([]interface{}{tag}, args...)...) } // Infof prints the debug log to the logger. -func (l *logger) Infof(format string, args ...interface{}) { +func (*logger) Infof(format string, args ...interface{}) { log.Debugf(tag+"\t"+format, args...) } // Warning prints the warning log to the logger. -func (l *logger) Warning(args ...interface{}) { +func (*logger) Warning(args ...interface{}) { log.Warn(append([]interface{}{tag}, args...)...) } // Warningln prints the warning log to the logger. -func (l *logger) Warningln(args ...interface{}) { +func (*logger) Warningln(args ...interface{}) { log.Warn(append([]interface{}{tag}, args...)...) } // Warningf prints the warning log to the logger. -func (l *logger) Warningf(format string, args ...interface{}) { +func (*logger) Warningf(format string, args ...interface{}) { log.Warnf(tag+"\t"+format, args...) } // Error prints the error log to the logger. -func (l *logger) Error(args ...interface{}) { +func (*logger) Error(args ...interface{}) { log.Error(append([]interface{}{tag}, args...)...) } // Errorln prints the error log to the logger. -func (l *logger) Errorln(args ...interface{}) { +func (*logger) Errorln(args ...interface{}) { log.Error(append([]interface{}{tag}, args...)...) } // Errorf prints the error log to the logger. -func (l *logger) Errorf(format string, args ...interface{}) { +func (*logger) Errorf(format string, args ...interface{}) { log.Errorf(tag+"\t"+format, args...) } // Fatal prints the fatal log to the logger and exit the program. -func (l *logger) Fatal(args ...interface{}) { +func (*logger) Fatal(args ...interface{}) { // skipcq: RVV-A0003 log.Fatal(append([]interface{}{tag}, args...)...) } // Fatalln prints the fatal log to the logger and exit the program. -func (l *logger) Fatalln(args ...interface{}) { +func (*logger) Fatalln(args ...interface{}) { // skipcq: RVV-A0003 log.Fatal(append([]interface{}{tag}, args...)...) } // Fatalf prints the fatal log to the logger and exit the program. -func (l *logger) Fatalf(format string, args ...interface{}) { +func (*logger) Fatalf(format string, args ...interface{}) { // skipcq: RVV-A0003 log.Fatalf(tag+"\t"+format, args...) } diff --git a/internal/net/grpc/pool/pool_bench_test.go b/internal/net/grpc/pool/pool_bench_test.go index 287dbc6c95..2a80e08809 100644 --- a/internal/net/grpc/pool/pool_bench_test.go +++ b/internal/net/grpc/pool/pool_bench_test.go @@ -44,7 +44,7 @@ func init() { log.Init(log.WithLevel(level.ERROR.String())) } -func (s *server) Pods(context.Context, *payload.Discoverer_Request) (*payload.Info_Pods, error) { +func (*server) Pods(context.Context, *payload.Discoverer_Request) (*payload.Info_Pods, error) { return &payload.Info_Pods{ Pods: []*payload.Info_Pod{ { @@ -54,7 +54,7 @@ func (s *server) Pods(context.Context, *payload.Discoverer_Request) (*payload.In }, nil } -func (s *server) Nodes(context.Context, *payload.Discoverer_Request) (*payload.Info_Nodes, error) { +func (*server) Nodes(context.Context, *payload.Discoverer_Request) (*payload.Info_Nodes, error) { return new(payload.Info_Nodes), nil } diff --git a/internal/net/http/routing/router.go b/internal/net/http/routing/router.go index 57a41f91a5..3616d70e44 100644 --- a/internal/net/http/routing/router.go +++ b/internal/net/http/routing/router.go @@ -60,7 +60,7 @@ func New(opts ...Option) http.Handler { // routing wraps the handler.Func and returns a new http.Handler. // routing helps to handle unsupported HTTP method, timeout, // and the error returned from the handler.Func. -func (rt *router) routing( +func (*router) routing( name, path string, m []string, h rest.Func, ) http.Handler { return http.HandlerFunc( diff --git a/internal/observability/metrics/agent/sidecar/sidecar.go b/internal/observability/metrics/agent/sidecar/sidecar.go index 8c6599fd85..d056f43422 100644 --- a/internal/observability/metrics/agent/sidecar/sidecar.go +++ b/internal/observability/metrics/agent/sidecar/sidecar.go @@ -58,7 +58,7 @@ func New() MetricsHook { } } -func (sm *sidecarMetrics) View() ([]*metrics.View, error) { +func (*sidecarMetrics) View() ([]*metrics.View, error) { uploadTotal, err := view.New( view.MatchInstrumentName(uploadTotalMetricsName), view.WithSetDescription(uploadTotalMetricsDescription), @@ -152,7 +152,7 @@ func (sm *sidecarMetrics) Register(m metrics.Meter) error { ) } -func (sm *sidecarMetrics) BeforeProcess(ctx context.Context, info *observer.BackupInfo) (context.Context, error) { +func (*sidecarMetrics) BeforeProcess(ctx context.Context, info *observer.BackupInfo) (context.Context, error) { return ctx, nil } diff --git a/internal/observability/metrics/backoff/backoff.go b/internal/observability/metrics/backoff/backoff.go index df74fe5de5..cacbbef158 100644 --- a/internal/observability/metrics/backoff/backoff.go +++ b/internal/observability/metrics/backoff/backoff.go @@ -38,7 +38,7 @@ func New() metrics.Metric { } } -func (bm *backoffMetrics) View() ([]*metrics.View, error) { +func (*backoffMetrics) View() ([]*metrics.View, error) { retryCount, err := view.New( view.MatchInstrumentName(metricsName), view.WithSetDescription(metricsDescription), diff --git a/internal/observability/metrics/circuitbreaker/circuitbreaker.go b/internal/observability/metrics/circuitbreaker/circuitbreaker.go index 05b7584593..8375c1ef3a 100644 --- a/internal/observability/metrics/circuitbreaker/circuitbreaker.go +++ b/internal/observability/metrics/circuitbreaker/circuitbreaker.go @@ -40,7 +40,7 @@ func New() metrics.Metric { } } -func (bm *breakerMetrics) View() ([]*metrics.View, error) { +func (*breakerMetrics) View() ([]*metrics.View, error) { breakerState, err := view.New( view.MatchInstrumentName(metricsName), view.WithSetDescription(metricsDescription), diff --git a/internal/observability/metrics/grpc/grpc.go b/internal/observability/metrics/grpc/grpc.go index 88fe048da0..ae32c55ada 100644 --- a/internal/observability/metrics/grpc/grpc.go +++ b/internal/observability/metrics/grpc/grpc.go @@ -33,7 +33,7 @@ func New() metrics.Metric { return &grpcServerMetrics{} } -func (gm *grpcServerMetrics) View() ([]*metrics.View, error) { +func (*grpcServerMetrics) View() ([]*metrics.View, error) { latencyHistgram, err := view.New( view.MatchInstrumentName(latencyMetricsName), view.WithSetDescription(latencyMetricsDesctiption), @@ -59,7 +59,7 @@ func (gm *grpcServerMetrics) View() ([]*metrics.View, error) { }, nil } -func (gm *grpcServerMetrics) Register(m metrics.Meter) error { +func (*grpcServerMetrics) Register(m metrics.Meter) error { // The metrics are dynamically registered at the grpc server interceptor package, // so do nothing in this part return nil diff --git a/internal/observability/metrics/manager/index/index.go b/internal/observability/metrics/manager/index/index.go index 7e4062ba1b..d0ddf3e40d 100644 --- a/internal/observability/metrics/manager/index/index.go +++ b/internal/observability/metrics/manager/index/index.go @@ -43,7 +43,7 @@ func New(i service.Indexer) metrics.Metric { } } -func (im *indexerMetrics) View() ([]*metrics.View, error) { +func (*indexerMetrics) View() ([]*metrics.View, error) { uuidCount, err := view.New( view.MatchInstrumentName(uuidCountMetricsName), view.WithSetDescription(uuidCountMetricsDescription), diff --git a/internal/observability/metrics/mem/index/index.go b/internal/observability/metrics/mem/index/index.go index a40b0dcb4f..788301d4c7 100644 --- a/internal/observability/metrics/mem/index/index.go +++ b/internal/observability/metrics/mem/index/index.go @@ -73,7 +73,7 @@ func New() metrics.Metric { return &memoryMetrics{} } -func (mm *memoryMetrics) View() ([]*metrics.View, error) { +func (*memoryMetrics) View() ([]*metrics.View, error) { alloc, err := view.New( view.MatchInstrumentName(allocMetricsDescription), view.WithSetDescription(allocMetricsDescription), @@ -218,7 +218,7 @@ func (mm *memoryMetrics) View() ([]*metrics.View, error) { }, nil } -func (mm *memoryMetrics) Register(m metrics.Meter) error { +func (*memoryMetrics) Register(m metrics.Meter) error { alloc, err := m.AsyncInt64().Gauge( allocMetricsName, metrics.WithDescription(allocMetricsDescription), diff --git a/internal/observability/metrics/runtime/cgo/cgo.go b/internal/observability/metrics/runtime/cgo/cgo.go index 855bf0d97f..c58df3de58 100644 --- a/internal/observability/metrics/runtime/cgo/cgo.go +++ b/internal/observability/metrics/runtime/cgo/cgo.go @@ -33,7 +33,7 @@ func New() metrics.Metric { return &cgo{} } -func (c *cgo) View() ([]*metrics.View, error) { +func (*cgo) View() ([]*metrics.View, error) { count, err := view.New( view.MatchInstrumentName(metricsName), view.WithSetDescription(metricsDescription), @@ -47,7 +47,7 @@ func (c *cgo) View() ([]*metrics.View, error) { }, nil } -func (c *cgo) Register(m metrics.Meter) error { +func (*cgo) Register(m metrics.Meter) error { count, err := m.AsyncInt64().Gauge( metricsName, metrics.WithDescription(metricsDescription), diff --git a/internal/observability/metrics/runtime/goroutine/goroutine.go b/internal/observability/metrics/runtime/goroutine/goroutine.go index 64866f2300..6a84e267f8 100644 --- a/internal/observability/metrics/runtime/goroutine/goroutine.go +++ b/internal/observability/metrics/runtime/goroutine/goroutine.go @@ -33,7 +33,7 @@ func New() metrics.Metric { return &goroutine{} } -func (g *goroutine) View() ([]*metrics.View, error) { +func (*goroutine) View() ([]*metrics.View, error) { count, err := view.New( view.MatchInstrumentName(metricsName), view.WithSetDescription(metricsDescription), @@ -48,7 +48,7 @@ func (g *goroutine) View() ([]*metrics.View, error) { }, nil } -func (g *goroutine) Register(m metrics.Meter) error { +func (*goroutine) Register(m metrics.Meter) error { conter, err := m.AsyncInt64().Gauge( metricsName, metrics.WithDescription(metricsDescription), diff --git a/internal/observability/metrics/version/version.go b/internal/observability/metrics/version/version.go index 892f8eb30d..3671cf6391 100644 --- a/internal/observability/metrics/version/version.go +++ b/internal/observability/metrics/version/version.go @@ -76,7 +76,7 @@ func labelKVs(labels ...string) map[string]string { return info } -func (v *version) View() ([]*metrics.View, error) { +func (*version) View() ([]*metrics.View, error) { otlv, err := view.New( view.MatchInstrumentName(name), view.WithSetDescription(description), diff --git a/internal/observability/observability.go b/internal/observability/observability.go index 66b5d09958..73c220cbac 100644 --- a/internal/observability/observability.go +++ b/internal/observability/observability.go @@ -148,7 +148,7 @@ func (o *observability) PreStart(ctx context.Context) error { return nil } -func (o *observability) Start(ctx context.Context) <-chan error { +func (*observability) Start(ctx context.Context) <-chan error { return nil } diff --git a/internal/observability/trace/trace.go b/internal/observability/trace/trace.go index e40e4fd1b1..6f4fc705b9 100644 --- a/internal/observability/trace/trace.go +++ b/internal/observability/trace/trace.go @@ -75,7 +75,7 @@ func New(opts ...TraceOption) (Tracer, error) { return t, nil } -func (t *tracer) Start(ctx context.Context) error { +func (*tracer) Start(ctx context.Context) error { otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) return nil } diff --git a/pkg/agent/core/ngt/handler/rest/handler.go b/pkg/agent/core/ngt/handler/rest/handler.go index 2b5d5fcb6c..5b6ac24c7a 100644 --- a/pkg/agent/core/ngt/handler/rest/handler.go +++ b/pkg/agent/core/ngt/handler/rest/handler.go @@ -58,7 +58,7 @@ func New(opts ...Option) Handler { return h } -func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) diff --git a/pkg/agent/core/ngt/usecase/agentd.go b/pkg/agent/core/ngt/usecase/agentd.go index 43e10bb43f..119d81e102 100644 --- a/pkg/agent/core/ngt/usecase/agentd.go +++ b/pkg/agent/core/ngt/usecase/agentd.go @@ -175,7 +175,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -func (r *run) PreStop(ctx context.Context) error { +func (*run) PreStop(ctx context.Context) error { return nil } diff --git a/pkg/agent/sidecar/handler/rest/handler.go b/pkg/agent/sidecar/handler/rest/handler.go index 9c2034b1d6..767686e630 100644 --- a/pkg/agent/sidecar/handler/rest/handler.go +++ b/pkg/agent/sidecar/handler/rest/handler.go @@ -42,7 +42,7 @@ func New(opts ...Option) Handler { return h } -func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) diff --git a/pkg/agent/sidecar/service/observer/observer.go b/pkg/agent/sidecar/service/observer/observer.go index ee3721cf29..cde8674348 100644 --- a/pkg/agent/sidecar/service/observer/observer.go +++ b/pkg/agent/sidecar/service/observer/observer.go @@ -377,7 +377,7 @@ func (o *observer) isValidMetadata() (bool, error) { return !metadata.IsInvalid, nil } -func (o *observer) terminate() error { +func (*observer) terminate() error { log.Error("the process will be terminated because the files are invalid") p, err := os.FindProcess(os.Getpid()) diff --git a/pkg/agent/sidecar/usecase/sidecar/sidecar.go b/pkg/agent/sidecar/usecase/sidecar/sidecar.go index 231793d63e..ab21cb23e9 100644 --- a/pkg/agent/sidecar/usecase/sidecar/sidecar.go +++ b/pkg/agent/sidecar/usecase/sidecar/sidecar.go @@ -266,7 +266,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -func (r *run) PreStop(ctx context.Context) error { +func (*run) PreStop(ctx context.Context) error { return nil } diff --git a/pkg/discoverer/k8s/handler/grpc/handler.go b/pkg/discoverer/k8s/handler/grpc/handler.go index 0d9491e85d..ce6c608476 100644 --- a/pkg/discoverer/k8s/handler/grpc/handler.go +++ b/pkg/discoverer/k8s/handler/grpc/handler.go @@ -69,7 +69,7 @@ func New(opts ...Option) (ds DiscovererServer, err error) { return s, nil } -func (s *server) Start(ctx context.Context) { +func (*server) Start(ctx context.Context) { } func (s *server) Pods(ctx context.Context, req *payload.Discoverer_Request) (*payload.Info_Pods, error) { diff --git a/pkg/discoverer/k8s/handler/rest/handler.go b/pkg/discoverer/k8s/handler/rest/handler.go index 4d3c9328d4..92ed587237 100644 --- a/pkg/discoverer/k8s/handler/rest/handler.go +++ b/pkg/discoverer/k8s/handler/rest/handler.go @@ -45,7 +45,7 @@ func New(opts ...Option) Handler { return h } -func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) diff --git a/pkg/discoverer/k8s/usecase/discovered.go b/pkg/discoverer/k8s/usecase/discovered.go index 4de13c6a0e..2511732edf 100644 --- a/pkg/discoverer/k8s/usecase/discovered.go +++ b/pkg/discoverer/k8s/usecase/discovered.go @@ -188,7 +188,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -func (r *run) PreStop(ctx context.Context) error { +func (*run) PreStop(ctx context.Context) error { return nil } @@ -199,6 +199,6 @@ func (r *run) Stop(ctx context.Context) error { return r.server.Shutdown(ctx) } -func (r *run) PostStop(ctx context.Context) error { +func (*run) PostStop(ctx context.Context) error { return nil } diff --git a/pkg/gateway/filter/handler/rest/handler.go b/pkg/gateway/filter/handler/rest/handler.go index 19c475d3d3..dbfcb2797a 100644 --- a/pkg/gateway/filter/handler/rest/handler.go +++ b/pkg/gateway/filter/handler/rest/handler.go @@ -69,7 +69,7 @@ func New(opts ...Option) Handler { return h } -func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) diff --git a/pkg/gateway/lb/handler/rest/handler.go b/pkg/gateway/lb/handler/rest/handler.go index dc68b1a273..b094e99edb 100644 --- a/pkg/gateway/lb/handler/rest/handler.go +++ b/pkg/gateway/lb/handler/rest/handler.go @@ -61,7 +61,7 @@ func New(opts ...Option) Handler { return h } -func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) diff --git a/pkg/gateway/lb/usecase/vald.go b/pkg/gateway/lb/usecase/vald.go index 9af1829b00..d51fa5b604 100644 --- a/pkg/gateway/lb/usecase/vald.go +++ b/pkg/gateway/lb/usecase/vald.go @@ -193,7 +193,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -func (r *run) PreStop(ctx context.Context) error { +func (*run) PreStop(ctx context.Context) error { return nil } @@ -204,6 +204,6 @@ func (r *run) Stop(ctx context.Context) error { return r.server.Shutdown(ctx) } -func (r *run) PostStop(ctx context.Context) error { +func (*run) PostStop(ctx context.Context) error { return nil } diff --git a/pkg/manager/index/handler/rest/handler.go b/pkg/manager/index/handler/rest/handler.go index 41a72e677c..facba68b58 100644 --- a/pkg/manager/index/handler/rest/handler.go +++ b/pkg/manager/index/handler/rest/handler.go @@ -44,7 +44,7 @@ func New(opts ...Option) Handler { return h } -func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) diff --git a/pkg/manager/index/usecase/indexer.go b/pkg/manager/index/usecase/indexer.go index 2f96435904..66263008e5 100644 --- a/pkg/manager/index/usecase/indexer.go +++ b/pkg/manager/index/usecase/indexer.go @@ -206,7 +206,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -func (r *run) PreStop(ctx context.Context) error { +func (*run) PreStop(ctx context.Context) error { return nil } @@ -217,6 +217,6 @@ func (r *run) Stop(ctx context.Context) error { return r.server.Shutdown(ctx) } -func (r *run) PostStop(ctx context.Context) error { +func (*run) PostStop(ctx context.Context) error { return nil } diff --git a/pkg/tools/cli/loadtest/usecase/load.go b/pkg/tools/cli/loadtest/usecase/load.go index e41f7d68b7..ad962089de 100644 --- a/pkg/tools/cli/loadtest/usecase/load.go +++ b/pkg/tools/cli/loadtest/usecase/load.go @@ -120,7 +120,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { } // PreStop does nothing. -func (r *run) PreStop(ctx context.Context) error { +func (*run) PreStop(ctx context.Context) error { return nil } @@ -130,6 +130,6 @@ func (r *run) Stop(ctx context.Context) error { } // PostStop does nothing. -func (r *run) PostStop(ctx context.Context) error { +func (*run) PostStop(ctx context.Context) error { return nil }