-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Dummy implementation of UsageService (2/5) #11290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8feacb8
to
dfde0b6
Compare
4f0ea03
to
c9e8162
Compare
c9e8162
to
6e30b14
Compare
"google.golang.org/protobuf/testing/protocmp" | ||
) | ||
|
||
func TestUsageService_GetBilledUsage(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsageRequest) (*v1.GetBilledUsageResponse, error) { | ||
// TODO(geropl) Dummy data for now | ||
response := v1.GetBilledUsageResponse{} | ||
return &response, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wanted a terser version, you could do
func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsageRequest) (*v1.GetBilledUsageResponse, error) { | |
// TODO(geropl) Dummy data for now | |
response := v1.GetBilledUsageResponse{} | |
return &response, nil | |
} | |
func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsageRequest) (resp *v1.GetBilledUsageResponse, err error) { | |
return resp, err | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but I generally prefer the explicit syntax - and room for the comment. 😉
Description
Dummy implementation of UsageService
Related Issue(s)
Context: #10325
How to test
(cd components/usage && go test -v ./...)
Release Notes
Documentation
Werft options: