rob05c commented on code in PR #6883:
URL: https://github.com/apache/trafficcontrol/pull/6883#discussion_r916198979


##########
cache-config/t3cutil/getdata.go:
##########
@@ -54,6 +54,10 @@ type TCCfg struct {
 
        // OldCfg is the previously fetched ConfigData, for 'config' requests. 
May be nil.
        OldCfg *ConfigData
+
+       // T3cVersion is the version of the t3c app ecosystem
+       // This value will be the same for any t3c app.
+       T3CVersion string

Review Comment:
   > It just seems a little strange to tell a utility which could be wrong when 
the utility ostensibly always knows the correct value.
   
   To clarify: it's in this struct, because this struct is what get passed from 
the app (`t3c-apply`) to the library function that needs it in `t3cutil`. It 
should never be changed. 
   
   I could have made it impossible to change, by making it a function of the 
struct instead. But that isn't idiomatic Go, and it adds more complexity and 
increases the dev cost to read and write it. I decided the complexity and 
readability cost wasn't worth the very minor safety gain (especially 
considering Go standard libraries use non-const variables all over the place, 
that are equally "unsafe").



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