Prepare for a type-safe OnceKey
Add an opaque OnceKey type and use it for all calls to Once in
build/soong. A future patch will convert the arguments to
Once* to OnceKey once users outside build/soong have been updated.
Test: onceper_test.go
Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
diff --git a/android/arch.go b/android/arch.go
index 953e6cf..ad812a4 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -879,7 +879,7 @@
propertiesValue.Interface()))
}
- archPropTypes := archPropTypeMap.Once(t, func() interface{} {
+ archPropTypes := archPropTypeMap.Once(NewCustomOnceKey(t), func() interface{} {
return createArchType(t)
}).([]reflect.Type)