Skip to content

Commit bbaa535

Browse files
style: second round of linting (#15607)
Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent 68cd9c5 commit bbaa535

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

tools/hubl/internal/compat.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ func addMissingFileDescriptors(ctx context.Context, client *grpc.ClientConn, fdM
176176
panic(err)
177177
}
178178

179-
switch res := in.MessageResponse.(type) {
180-
case *grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse:
179+
if res, ok := in.MessageResponse.(*grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse); ok {
181180
processFileDescriptorsResponse(res, fdMap)
182181
}
183182
}

tools/hubl/internal/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func SaveConfig(configDir string, config *Config) error {
5454
}
5555

5656
configPath := configFilename(configDir)
57-
if err := os.WriteFile(configPath, buf.Bytes(), 0o644); err != nil {
57+
if err := os.WriteFile(configPath, buf.Bytes(), 0o600); err != nil {
5858
return err
5959
}
6060

tools/hubl/internal/load.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (c *ChainInfo) Load(reload bool) error {
9292
return err
9393
}
9494

95-
if err = os.WriteFile(fdsFilename, bz, 0o644); err != nil {
95+
if err = os.WriteFile(fdsFilename, bz, 0o600); err != nil {
9696
return err
9797
}
9898
} else {
@@ -133,7 +133,7 @@ func (c *ChainInfo) Load(reload bool) error {
133133
return err
134134
}
135135

136-
err = os.WriteFile(appOptsFilename, bz, 0o644)
136+
err = os.WriteFile(appOptsFilename, bz, 0o600)
137137
if err != nil {
138138
return err
139139
}

tools/hubl/internal/remote.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,13 @@ func RemoteCommand(config *Config, configDir string) ([]*cobra.Command, error) {
111111
Use: chain,
112112
Short: fmt.Sprintf("Commands for the %s chain", chain),
113113
RunE: func(cmd *cobra.Command, args []string) error {
114-
if reconfig {
114+
switch {
115+
case reconfig:
115116
return reconfigure(cmd, config, configDir, chain)
116-
} else if update {
117+
case update:
117118
cmd.Printf("Updating autocli data for %s\n", chain)
118119
return chainInfo.Load(true)
119-
} else {
120+
default:
120121
return cmd.Help()
121122
}
122123
},

x/nft/keeper/nft.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (k Keeper) GetNFTsOfClass(ctx context.Context, classID string) (nfts []nft.
167167
}
168168

169169
// GetOwner returns the owner information of the specified nft
170-
func (k Keeper) GetOwner(ctx context.Context, classID string, nftID string) sdk.AccAddress {
170+
func (k Keeper) GetOwner(ctx context.Context, classID, nftID string) sdk.AccAddress {
171171
store := k.storeService.OpenKVStore(ctx)
172172
bz, err := store.Get(ownerStoreKey(classID, nftID))
173173
if err != nil {

0 commit comments

Comments
 (0)