mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 15:17:25 +08:00
refactoring function parameter
This commit is contained in:
@@ -25,8 +25,8 @@ func (c *commandCollectionList) Help() string {
|
||||
func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
||||
|
||||
var resp *master_pb.CollectionListResponse
|
||||
|
||||
err = commandEnv.masterClient.WithClient(context.Background(), func(ctx context.Context, client master_pb.SeaweedClient) error {
|
||||
ctx := context.Background()
|
||||
err = commandEnv.masterClient.WithClient(ctx, func(client master_pb.SeaweedClient) error {
|
||||
resp, err = client.CollectionList(ctx, &master_pb.CollectionListRequest{})
|
||||
return err
|
||||
})
|
||||
|
@@ -25,7 +25,8 @@ func (c *commandVolumeList) Help() string {
|
||||
func (c *commandVolumeList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
||||
|
||||
var resp *master_pb.VolumeListResponse
|
||||
err = commandEnv.masterClient.WithClient(context.Background(), func(ctx context.Context, client master_pb.SeaweedClient) error {
|
||||
ctx := context.Background()
|
||||
err = commandEnv.masterClient.WithClient(ctx, func(client master_pb.SeaweedClient) error {
|
||||
resp, err = client.VolumeList(ctx, &master_pb.VolumeListRequest{})
|
||||
return err
|
||||
})
|
||||
|
Reference in New Issue
Block a user