pbacsko commented on code in PR #747:
URL: https://github.com/apache/yunikorn-k8shim/pull/747#discussion_r1419727823


##########
pkg/common/utils/utils.go:
##########
@@ -180,6 +180,9 @@ func PodUnderCondition(pod *v1.Pod, condition 
*v1.PodCondition) bool {
 func GetNamespaceGuaranteedFromAnnotation(namespaceObj *v1.Namespace) 
*si.Resource {
        // retrieve guaranteed resource info from annotations
        namespaceGuaranteed := GetNameSpaceAnnotationValue(namespaceObj, 
constants.NamespaceGuaranteed)

Review Comment:
   I believe this is more Go-like:
   ```
   if guaranteed := GetNameSpaceAnnotationValue(namespaceObj, 
constants.NamespaceGuaranteed); guaranteed != "" {
     ...
   }
   return nil
   ```
   
   No need to name it "namespaceGuaranteed", it's pretty obvious from the 
context. Prefer shorter variables if possible.



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