From 37bd28f455b7639e4ea843ba51514515ab2f4d7e Mon Sep 17 00:00:00 2001 From: James Phillips Date: Fri, 4 Mar 2016 17:07:52 -0800 Subject: [PATCH] Adds a comment about the embedded struct. --- consul/state/prepared_query.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/consul/state/prepared_query.go b/consul/state/prepared_query.go index 8e5a4e26dcbe..c84496fbddc2 100644 --- a/consul/state/prepared_query.go +++ b/consul/state/prepared_query.go @@ -20,7 +20,13 @@ func isUUID(str string) bool { // queryWrapper is an internal structure that is used to store a query alongside // its compiled template, which can be nil. type queryWrapper struct { + // We embed the PreparedQuery structure so that the UUID field indexer + // can see the ID directly. *structs.PreparedQuery + + // ct is the compiled template, or nil if the query isn't a template. The + // state store manages this and keeps it up to date every time the query + // changes. ct *prepared_query.CompiledTemplate }