diff --git a/README.md b/README.md index e197356..e8db382 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,10 @@ func NewMyDataHub() sabi.DataHub { SettingDataAcc: &SettingDataAcc{DataAcc: hub}, } } + +// Since this statement does not remain in the runtime binary, it is a good idea to include it +// in actual code as a compile-time check to ensure that all methods have been fully implemented. +var _ MyData = (*MyDataHub)(nil) ``` ### 5. Using logic functions and `DataHub` diff --git a/data-acc_test.go b/data-acc_test.go index f259725..325ece5 100644 --- a/data-acc_test.go +++ b/data-acc_test.go @@ -222,6 +222,10 @@ func NewSampleDataHub() sabi.DataHub { } } +// Since this statement does not remain in the runtime binary, it is a good idea to include it +// in actual code as a compile-time check to ensure that all methods have been fully implemented. +var _ SampleData = (*SampleDataHub)(nil) + /// func TestDataHubRunUsingGlobal(t *testing.T) { diff --git a/doc.go b/doc.go index 2437503..a7201f9 100644 --- a/doc.go +++ b/doc.go @@ -113,6 +113,10 @@ The following is a sample code using this framework } } + // Since this statement does not remain in the runtime binary, it is a good idea to include it + // in actual code as a compile-time check to ensure that all methods have been fully implemented. + var _ MyData = (*MyDataHub)(nil) + // (5) Use the logic functions and the DataHub func init() {