style: second round of linting (#15607)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
Marko 2023-03-30 10:21:59 +02:00 committed by GitHub
parent 68cd9c505b
commit bbaa5352b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

@ -176,8 +176,7 @@ func addMissingFileDescriptors(ctx context.Context, client *grpc.ClientConn, fdM
panic(err)
}
switch res := in.MessageResponse.(type) {
case *grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse:
if res, ok := in.MessageResponse.(*grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse); ok {
processFileDescriptorsResponse(res, fdMap)
}
}

View File

@ -54,7 +54,7 @@ func SaveConfig(configDir string, config *Config) error {
}
configPath := configFilename(configDir)
if err := os.WriteFile(configPath, buf.Bytes(), 0o644); err != nil {
if err := os.WriteFile(configPath, buf.Bytes(), 0o600); err != nil {
return err
}

View File

@ -92,7 +92,7 @@ func (c *ChainInfo) Load(reload bool) error {
return err
}
if err = os.WriteFile(fdsFilename, bz, 0o644); err != nil {
if err = os.WriteFile(fdsFilename, bz, 0o600); err != nil {
return err
}
} else {
@ -133,7 +133,7 @@ func (c *ChainInfo) Load(reload bool) error {
return err
}
err = os.WriteFile(appOptsFilename, bz, 0o644)
err = os.WriteFile(appOptsFilename, bz, 0o600)
if err != nil {
return err
}

View File

@ -111,12 +111,13 @@ func RemoteCommand(config *Config, configDir string) ([]*cobra.Command, error) {
Use: chain,
Short: fmt.Sprintf("Commands for the %s chain", chain),
RunE: func(cmd *cobra.Command, args []string) error {
if reconfig {
switch {
case reconfig:
return reconfigure(cmd, config, configDir, chain)
} else if update {
case update:
cmd.Printf("Updating autocli data for %s\n", chain)
return chainInfo.Load(true)
} else {
default:
return cmd.Help()
}
},

View File

@ -167,7 +167,7 @@ func (k Keeper) GetNFTsOfClass(ctx context.Context, classID string) (nfts []nft.
}
// GetOwner returns the owner information of the specified nft
func (k Keeper) GetOwner(ctx context.Context, classID string, nftID string) sdk.AccAddress {
func (k Keeper) GetOwner(ctx context.Context, classID, nftID string) sdk.AccAddress {
store := k.storeService.OpenKVStore(ctx)
bz, err := store.Get(ownerStoreKey(classID, nftID))
if err != nil {