-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: remove unnecessary API wrapper methods in cfl #20
Copy link
Copy link
Closed
Description
Summary
Remove redundant HTTP method wrappers in cfl's API client that duplicate Go's automatic method promotion from embedded types.
Current State
tools/cfl/api/client.go (lines 23-41) has wrapper methods that just call the embedded client:
type Client struct {
*client.Client // embedded type
}
// These wrappers are unnecessary - embedding already promotes these methods
func (c *Client) Get(ctx context.Context, path string) ([]byte, error) {
return c.Client.Get(ctx, path)
}
func (c *Client) Post(ctx context.Context, path string, body interface{}) ([]byte, error) {
return c.Client.Post(ctx, path, body)
}
func (c *Client) Put(ctx context.Context, path string, body interface{}) ([]byte, error) {
return c.Client.Put(ctx, path, body)
}
func (c *Client) Delete(ctx context.Context, path string) error {
return c.Client.Delete(ctx, path)
}Proposed Changes
Delete lines 23-41. Go embedding automatically promotes the embedded *client.Client methods to the outer Client type.
Impact
~20 lines removed, 1 file changed
Note
Verify no code relies on method signatures that differ from the embedded type before removing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels