rob05c commented on a change in pull request #2803: Add Traffic Ops Golang 
Steering Targets
URL: https://github.com/apache/trafficcontrol/pull/2803#discussion_r217544690
 
 

 ##########
 File path: lib/go-tc/steeringtarget.go
 ##########
 @@ -47,9 +47,6 @@ type SteeringTargetNullable struct {
 
 func (st SteeringTargetNullable) Validate(tx *sql.Tx) error {
        errs := []string{}
-       if st.TargetID == nil {
 
 Review comment:
   Because the validation applies to the object. Not sure what you mean by 
"controller". If you mean the "CRUDer" objects, only a small percentage of our 
endpoints are "CRUD", by making all `Validate` funcs members of the real 
objects, we prevent them being scattered, and can keep them all in one place.
   
   Putting it in `lib/tc` also makes the validation accessible to external 
libraries, if it's useful to someone to do their own validation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to