From 24955920944857474e4f3499dbd09e557625f71a Mon Sep 17 00:00:00 2001 From: Ketsia Date: Fri, 16 Aug 2024 15:52:35 +0200 Subject: [PATCH] run lint --- internal/debug/lifecycle.go | 20 ++++++++++++++++++++ internal/debug/lifecycle_test.go | 20 ++++++++++++++++++++ internal/internal_worker.go | 5 +++-- internal/internal_worker_base.go | 3 ++- internal/internal_worker_test.go | 3 ++- internal/worker.go | 5 +++-- 6 files changed, 50 insertions(+), 6 deletions(-) diff --git a/internal/debug/lifecycle.go b/internal/debug/lifecycle.go index 81653a55e..a156d1497 100644 --- a/internal/debug/lifecycle.go +++ b/internal/debug/lifecycle.go @@ -1,3 +1,23 @@ +// Copyright (c) 2017-2021 Uber Technologies Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package debug import "go.uber.org/atomic" diff --git a/internal/debug/lifecycle_test.go b/internal/debug/lifecycle_test.go index 111989081..42532dec1 100644 --- a/internal/debug/lifecycle_test.go +++ b/internal/debug/lifecycle_test.go @@ -1,3 +1,23 @@ +// Copyright (c) 2017-2021 Uber Technologies Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package debug import ( diff --git a/internal/internal_worker.go b/internal/internal_worker.go index 147370173..dfae766be 100644 --- a/internal/internal_worker.go +++ b/internal/internal_worker.go @@ -29,7 +29,6 @@ import ( "encoding/hex" "errors" "fmt" - "go.uber.org/cadence/internal/debug" "io" "os" "reflect" @@ -40,6 +39,8 @@ import ( "sync/atomic" "time" + "go.uber.org/cadence/internal/debug" + "go.uber.org/cadence/internal/common/isolationgroup" "github.com/opentracing/opentracing-go" @@ -190,7 +191,7 @@ func ensureRequiredParams(params *workerExecutionParameters) { } if params.EventMonitoring.LifeCycle == nil { params.EventMonitoring.LifeCycle = debug.NewLifeCycle() - params.Logger.Debug("No PollerLifeCycle configured for cadence worker. Use noop PollerLifeCycle as default.") + params.Logger.Debug("No PollerLifeCycle configured for cadence worker. Use default one.") } } diff --git a/internal/internal_worker_base.go b/internal/internal_worker_base.go index fae6768e1..0b831fbde 100644 --- a/internal/internal_worker_base.go +++ b/internal/internal_worker_base.go @@ -27,13 +27,14 @@ import ( "context" "errors" "fmt" - "go.uber.org/cadence/internal/debug" "os" "runtime" "sync" "syscall" "time" + "go.uber.org/cadence/internal/debug" + "github.com/shirou/gopsutil/cpu" "github.com/uber-go/tally" "go.uber.org/zap" diff --git a/internal/internal_worker_test.go b/internal/internal_worker_test.go index 9de928ef3..a338d60d6 100644 --- a/internal/internal_worker_test.go +++ b/internal/internal_worker_test.go @@ -24,7 +24,6 @@ package internal import ( "context" "errors" - "go.uber.org/cadence/internal/debug" "os" "reflect" "runtime" @@ -32,6 +31,8 @@ import ( "testing" "time" + "go.uber.org/cadence/internal/debug" + "github.com/golang/mock/gomock" "github.com/opentracing/opentracing-go" "github.com/stretchr/testify/assert" diff --git a/internal/worker.go b/internal/worker.go index 83e288413..3e4116727 100644 --- a/internal/worker.go +++ b/internal/worker.go @@ -23,9 +23,10 @@ package internal import ( "context" - "go.uber.org/cadence/debug" "time" + "go.uber.org/cadence/debug" + "github.com/opentracing/opentracing-go" "github.com/uber-go/tally" "go.uber.org/zap" @@ -275,7 +276,7 @@ type ( // Optional: EventMonitoring provides a set of methods that can be used to collect // stats on the Worker for debugging purposes. - // default: noop implementation + // default: internal implementation provided // Deprecated: in development and very likely to change EventMonitoring debug.EventMonitoring }