You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/05/21 21:28:39 UTC

[GitHub] [trafficcontrol] srijeet0406 commented on a change in pull request #4694: More Topologies validation

srijeet0406 commented on a change in pull request #4694:
URL: https://github.com/apache/trafficcontrol/pull/4694#discussion_r428921275



##########
File path: traffic_ops/client/session.go
##########
@@ -307,7 +307,7 @@ func NewNoAuthSession(toURL string, insecure bool, userAgent string, useCache bo
 	}, useCache)
 }
 
-// ErrUnlessOk returns nil and an error if the given Response's status code is anything but 200 OK. This includes reading the Response.Body and Closing it. Otherwise, the given response and error are returned unchanged.
+// ErrUnlessOk returns the response an error if the given Response's status code is anything but 200 OK. This includes reading the Response.Body and Closing it. Otherwise, the given response and a nil error are returned.

Review comment:
       Should be `the response and an error`
   Also, shouldn't the comment say that this function returns three things?

##########
File path: traffic_ops/traffic_ops_golang/topology/validation.go
##########
@@ -57,9 +57,14 @@ func checkForEdgeParents(nodes []tc.TopologyNode, cachegroups []tc.CacheGroupNul
 	node := nodes[nodeIndex]
 	errs := make([]error, len(node.Parents))
 	for parentIndex := range node.Parents {
-		cacheGroupType := cachegroups[node.Parents[parentIndex]].Type
+		cachegroupIndex := node.Parents[parentIndex]

Review comment:
       This could be a part of the `range` statement above, wherein you'd get the index and the value in the step.




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

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