You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "wilfred-s (via GitHub)" <gi...@apache.org> on 2023/02/21 02:25:45 UTC

[GitHub] [yunikorn-core] wilfred-s commented on a diff in pull request #506: [YUNIKORN-1578][core] Use zap.Stringer instead of calling String on object

wilfred-s commented on code in PR #506:
URL: https://github.com/apache/yunikorn-core/pull/506#discussion_r1112471896


##########
pkg/common/resources/resources.go:
##########
@@ -909,7 +909,7 @@ func CalculateAbsUsedCapacity(capacity, used *Resource) *Resource {
 	}
 	if missingResources.Len() != 0 {
 		log.Logger().Debug("Absolute usage result is missing resource information",
-			zap.String("missing resource(s)", missingResources.String()))
+			zap.Stringer("missing resource(s)", &missingResources))

Review Comment:
   A much cleaner solution would be to change the init of the variable to:
   ```
   missingResources := &strings.Builder{}
   ```
   All functions of the Builder use pointer receivers and this is consistent for all calls.



-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org