Fix a bug in OncePer.Get that could return a waiter
OncePer.Get must call maybeWaitFor on the value it reads, otherwise
it could return a waiter instead of the real value.
Test: onceper_test.go
Change-Id: I7d407bd1c577dbb43bc14fa107d5f606bf2b1c67
diff --git a/android/onceper.go b/android/onceper.go
index f06f428..5ad17fa 100644
--- a/android/onceper.go
+++ b/android/onceper.go
@@ -70,7 +70,7 @@
panic(fmt.Errorf("Get() called before Once()"))
}
- return v
+ return once.maybeWaitFor(key, v)
}
// OnceStringSlice is the same as Once, but returns the value cast to a []string