chia7712 commented on code in PR #861:
URL: https://github.com/apache/yunikorn-k8shim/pull/861#discussion_r1650600134


##########
pkg/cache/task_state.go:
##########
@@ -314,6 +314,7 @@ func TaskStates() *TStates {
        return storeTaskStates
 }
 
+//nolint:funlen
 func newTaskState() *fsm.FSM {

Review Comment:
   this is production code, so maybe we can do a bit refactor? for example, we 
can add two helper methods to generate `eventDesc` and `callbacks`. With those 
helpers, `newTaskState` can be simplified to following style
   ```go
   func newTaskState() *fsm.FSM {
        states := TaskStates()
        return fsm.NewFSM(states.New, eventDesc(states), callbacks(states))
   }
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to