From f4fe6f9c3a53acdb4f0d7a176ad88608510e7c50 Mon Sep 17 00:00:00 2001 From: Ketsia Date: Thu, 29 Aug 2024 10:17:43 +0200 Subject: [PATCH] run linter and add type comments --- debug/types.go | 2 +- internal/common/debug/example_test.go | 3 ++- internal/common/debug/types.go | 9 +++++---- internal/internal_task_handlers.go | 3 ++- internal/internal_task_pollers.go | 3 ++- internal/internal_workflow_testsuite.go | 3 ++- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/debug/types.go b/debug/types.go index 19c7bb9dd..22315263f 100644 --- a/debug/types.go +++ b/debug/types.go @@ -48,7 +48,7 @@ type ( // Deprecated: in development and very likely to change ActivityInfo = internal.ActivityInfo - // Activities ... + // Activities is a list of executing activities on the worker // Deprecated: in development and very likely to change Activities = internal.Activities ) diff --git a/internal/common/debug/example_test.go b/internal/common/debug/example_test.go index 5ac8b45cc..2a2af6f42 100644 --- a/internal/common/debug/example_test.go +++ b/internal/common/debug/example_test.go @@ -23,8 +23,9 @@ package debug import ( "encoding/json" "fmt" - "go.uber.org/atomic" "sync" + + "go.uber.org/atomic" ) type ( diff --git a/internal/common/debug/types.go b/internal/common/debug/types.go index 7da34acb9..22c978e28 100644 --- a/internal/common/debug/types.go +++ b/internal/common/debug/types.go @@ -47,7 +47,7 @@ type ( ActivityTracker ActivityTracker } - // ActivityInfo ... + // ActivityInfo contains details on the executing activity // Deprecated: in development and very likely to change ActivityInfo struct { WorkflowID string @@ -59,13 +59,14 @@ type ( // ActivityTracker is a worker option to track executing activities on a worker // Deprecated: in development and very likely to change ActivityTracker interface { - // Start ... + // Start records activity execution Start(info ActivityInfo) Stopper - // Stats ... + // Stats returns a list of executing activity info Stats() Activities } - // Activities ... + // Activities is a list of executing activities on the worker + // Deprecated: in development and very likely to change Activities []struct { Info ActivityInfo Count int64 diff --git a/internal/internal_task_handlers.go b/internal/internal_task_handlers.go index 316c2e54d..b862e4427 100644 --- a/internal/internal_task_handlers.go +++ b/internal/internal_task_handlers.go @@ -27,7 +27,6 @@ import ( "context" "errors" "fmt" - "go.uber.org/cadence/internal/common/debug" "math" "reflect" "strings" @@ -35,6 +34,8 @@ import ( "sync/atomic" "time" + "go.uber.org/cadence/internal/common/debug" + "github.com/opentracing/opentracing-go" "github.com/uber-go/tally" "go.uber.org/zap" diff --git a/internal/internal_task_pollers.go b/internal/internal_task_pollers.go index 956eb13ca..eb0d7f37d 100644 --- a/internal/internal_task_pollers.go +++ b/internal/internal_task_pollers.go @@ -27,10 +27,11 @@ import ( "context" "errors" "fmt" - "go.uber.org/cadence/internal/common/debug" "sync" "time" + "go.uber.org/cadence/internal/common/debug" + "github.com/opentracing/opentracing-go" "github.com/pborman/uuid" "github.com/uber-go/tally" diff --git a/internal/internal_workflow_testsuite.go b/internal/internal_workflow_testsuite.go index cc593c830..16f358385 100644 --- a/internal/internal_workflow_testsuite.go +++ b/internal/internal_workflow_testsuite.go @@ -25,12 +25,13 @@ import ( "context" "errors" "fmt" - "go.uber.org/cadence/internal/common/debug" "reflect" "strings" "sync" "time" + "go.uber.org/cadence/internal/common/debug" + "github.com/facebookgo/clock" "github.com/golang/mock/gomock" "github.com/opentracing/opentracing-go"