Copilot commented on code in PR #3788:
URL: https://github.com/apache/thrift/pull/3788#discussion_r3917545543


##########
lib/go/test/tests/container_key_test.go:
##########
@@ -29,6 +29,11 @@ import (
        "github.com/apache/thrift/lib/go/thrift"
 )
 
+// ContainerKeyTest.thrift is generated without the struct_key_entries option,
+// so a struct-keyed map keeps the default Go representation: a map keyed by
+// pointer. This assignment stops that changing without a deliberate edit.
+var _ map[*containerkeytest.PlainKey]string = 
containerkeytest.NewDefaultStructKeyStruct().ByKey

Review Comment:
   This package-level type assertion calls NewDefaultStructKeyStruct() at init 
time, which adds unnecessary work/side effects during package initialization. 
You can keep the compile-time type check without evaluating a constructor by 
using the zero value of the generated struct.



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