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 2018/11/30 16:14:46 UTC

[GitHub] dangogh commented on a change in pull request #3064: v3.1.0 - now properly ignores lua comment headers in plaintext files

dangogh commented on a change in pull request #3064: v3.1.0 - now properly ignores lua comment headers in plaintext files
URL: https://github.com/apache/trafficcontrol/pull/3064#discussion_r237914545
 
 

 ##########
 File path: traffic_ops/testing/compare/compare.go
 ##########
 @@ -196,6 +197,32 @@ func readRespBodies(a *io.ReadCloser, b *io.ReadCloser) ([]byte, []byte, error)
 	return aBody, bBody, nil
 }
 
+// Scrubs out the traffic ops headers from the passed lines
+// Note that this assumes UNIX line endings
+func scrubPlainText(lines []string) string {
+	r := ""
+	for _, l := range lines {
+		if len(l) < len(SHORT_HEADER) {
+			r += l
+		} else if l[:len(SHORT_HEADER)] != SHORT_HEADER {
+
 
 Review comment:
   I think this would be cleaner reversing this compare and `continue` if it matches..   same w/ LUA_HEADER below.  Reduces nested indents and makes it clear that there's nothing more to do if it matches

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services