Skip to content

Commit

Permalink
nix: use golangci-lint compatible with go 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Jan 16, 2025
1 parent a00bce1 commit b81c608
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ in rec {

golangci-lint = prev.golangci-lint.override {
buildGoModule = args: prev.buildGo122Module ( args // rec {
version = "1.54.0";
version = "1.59.1";
src = prev.fetchFromGitHub {
owner = "golangci";
repo = "golangci-lint";
rev = "v${version}";
hash = "sha256-UXN5gN1SNv3uvBCliJQ+5PSGHRL7RyU6pmZtGUTFsrQ=";
hash = "sha256-VFU/qGyKBMYr0wtHXyaMjS5fXKAHWe99wDZuSyH8opg=";
};
vendorHash = "sha256-jUlK/A0HxBrIby2C0zYFtnxQX1bgKVyypI3QdH4u/rg=";
vendorHash = "sha256-yYwYISK1wM/mSlAcDSIwYRo8sRWgw2u+SsvgjH+Z/7M=";
});
};

Expand Down
3 changes: 2 additions & 1 deletion params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,8 @@ func (c *NodeConfig) Save() error {
}

configFilePath := filepath.Join(c.DataDir, "config.json")
if err := ioutil.WriteFile(configFilePath, data, os.ModePerm); err != nil {
// G306: Expect WriteFile permissions to be 0600 or less (gosec)
if err := ioutil.WriteFile(configFilePath, data, 0600); err != nil {
return err
}

Expand Down
2 changes: 2 additions & 0 deletions protocol/communities/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,7 @@ func (p *Persistence) GetCommunityRequestsToJoinRevealedAddresses(communityID []
func (p *Persistence) GetEncryptionKeyRequests(communityID []byte, channelIDs map[string]struct{}) (map[string]*EncryptionKeysRequestRecord, error) {
result := map[string]*EncryptionKeysRequestRecord{}

//nolint:gosec
query := "SELECT channel_id, requested_at, requested_count FROM community_encryption_keys_requests WHERE community_id = ? AND channel_id IN (?" + strings.Repeat(",?", len(channelIDs)-1) + ")"

args := make([]interface{}, 0, len(channelIDs)+1)
Expand Down Expand Up @@ -2158,6 +2159,7 @@ func (p *Persistence) UpdateAndPruneEncryptionKeyRequests(communityID types.HexB
}

// Delete entries that do not match the channelIDs list
//nolint:gosec
deleteQuery := "DELETE FROM community_encryption_keys_requests WHERE community_id = ? AND channel_id NOT IN (?" + strings.Repeat(",?", len(channelIDs)-1) + ")"
args := make([]interface{}, 0, len(channelIDs)+1)
args = append(args, communityID)
Expand Down
1 change: 1 addition & 0 deletions services/wallet/token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ func (tm *Manager) GetCachedBalancesByChain(accounts, tokenAddresses []common.Ad
chainIDStrings[i] = fmt.Sprintf("%d", chainID)
}

//nolint: gosec
query := `SELECT chain_id, user_address, token_address, raw_balance
FROM token_balances
WHERE user_address IN (` + strings.Join(accountStrings, ",") + `)
Expand Down

0 comments on commit b81c608

Please sign in to comment.