diff --git a/.golangci.yml b/.golangci.yml index b348b9ec8..a44e5ae71 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -80,6 +80,7 @@ linters: - depguard - execinquery - exhaustruct + - exportloopref - gochecknoinits - gomnd - gci diff --git a/cli/command_benchmark_compression.go b/cli/command_benchmark_compression.go index 5df1d26d9..a33d27510 100644 --- a/cli/command_benchmark_compression.go +++ b/cli/command_benchmark_compression.go @@ -83,9 +83,9 @@ func (c *commandBenchmarkCompression) readInputFile(ctx context.Context) ([]byte type compressionBechmarkResult struct { compression compression.Name throughput float64 - compressedSize int64 - allocations int64 - allocBytes int64 + compressedSize uint64 + allocations uint64 + allocBytes uint64 } func (c *commandBenchmarkCompression) shouldIncludeAlgorithm(name compression.Name) bool { @@ -179,9 +179,9 @@ func (c *commandBenchmarkCompression) runCompression(ctx context.Context, data [ var startMS, endMS runtime.MemStats - run := func(compressed *bytes.Buffer) int64 { + run := func(compressed *bytes.Buffer) uint64 { var ( - compressedSize int64 + compressedSize uint64 lastHash uint64 input = bytes.NewReader(nil) ) @@ -195,7 +195,7 @@ func (c *commandBenchmarkCompression) runCompression(ctx context.Context, data [ continue } - compressedSize = int64(compressed.Len()) + compressedSize = uint64(compressed.Len()) if c.verifyStable { h := hashOf(compressed.Bytes()) @@ -229,8 +229,8 @@ func (c *commandBenchmarkCompression) runCompression(ctx context.Context, data [ compression: name, throughput: perSecond, compressedSize: compressedSize, - allocations: int64(endMS.Mallocs - startMS.Mallocs), - allocBytes: int64(endMS.TotalAlloc - startMS.TotalAlloc), + allocations: endMS.Mallocs - startMS.Mallocs, + allocBytes: endMS.TotalAlloc - startMS.TotalAlloc, }) } @@ -265,7 +265,7 @@ func (c *commandBenchmarkCompression) runDecompression(ctx context.Context, data var startMS, endMS runtime.MemStats - run := func(decompressed *bytes.Buffer) int64 { + run := func(decompressed *bytes.Buffer) uint64 { input := bytes.NewReader(nil) for range cnt { @@ -277,7 +277,7 @@ func (c *commandBenchmarkCompression) runDecompression(ctx context.Context, data } } - return int64(compressedInput.Length()) + return uint64(compressedInput.Length()) } outputBuffers := makeOutputBuffers(c.parallel, defaultCompressedDataByMethod) @@ -297,8 +297,8 @@ func (c *commandBenchmarkCompression) runDecompression(ctx context.Context, data compression: name, throughput: perSecond, compressedSize: compressedSize, - allocations: int64(endMS.Mallocs - startMS.Mallocs), - allocBytes: int64(endMS.TotalAlloc - startMS.TotalAlloc), + allocations: endMS.Mallocs - startMS.Mallocs, + allocBytes: endMS.TotalAlloc - startMS.TotalAlloc, }) } diff --git a/cli/command_index_recover.go b/cli/command_index_recover.go index 858dbc746..f85544dd0 100644 --- a/cli/command_index_recover.go +++ b/cli/command_index_recover.go @@ -196,7 +196,7 @@ func (c *commandIndexRecover) recoverIndexFromSinglePackFile(ctx context.Context return errors.Wrapf(err, "unable to recover index from %v", blobID) } - recoveredContentCount.Add(int32(len(recovered))) + recoveredContentCount.Add(int32(len(recovered))) //nolint:gosec processedBlobCount.Add(1) log(ctx).Debugf("Recovered %v entries from %v (commit=%v)", len(recovered), blobID, c.commit) diff --git a/cli/command_policy_set.go b/cli/command_policy_set.go index f0cde6351..9b6bdfdc6 100644 --- a/cli/command_policy_set.go +++ b/cli/command_policy_set.go @@ -142,8 +142,8 @@ func (c *commandPolicySet) setPolicyFromFlags(ctx context.Context, p *policy.Pol return nil } -func applyPolicyStringList(ctx context.Context, desc string, val *[]string, add, remove []string, clear bool, changeCount *int) { - if clear { +func applyPolicyStringList(ctx context.Context, desc string, val *[]string, add, remove []string, clearList bool, changeCount *int) { + if clearList { log(ctx).Infof(" - removing all from %q", desc) *changeCount++ diff --git a/cli/password.go b/cli/password.go index be8a89942..dfbd0b408 100644 --- a/cli/password.go +++ b/cli/password.go @@ -97,7 +97,7 @@ func askPass(out io.Writer, prompt string) (string, error) { for range 5 { fmt.Fprint(out, prompt) //nolint:errcheck - passBytes, err := term.ReadPassword(int(os.Stdin.Fd())) + passBytes, err := term.ReadPassword(int(os.Stdin.Fd())) //nolint:gosec if err != nil { return "", errors.Wrap(err, "password prompt error") } diff --git a/cli/storage_filesystem.go b/cli/storage_filesystem.go index 8a855b7c7..18836c049 100644 --- a/cli/storage_filesystem.go +++ b/cli/storage_filesystem.go @@ -92,7 +92,7 @@ func getIntPtrValue(value string, base int) *int { func getFileModeValue(value string, def os.FileMode) os.FileMode { if uint32Val, err := strconv.ParseUint(value, 8, 32); err == nil { - return os.FileMode(uint32Val) + return os.FileMode(uint32Val) //nolint:gosec } return def diff --git a/internal/bigmap/bigmap_internal.go b/internal/bigmap/bigmap_internal.go index a81017d19..06ad26a31 100644 --- a/internal/bigmap/bigmap_internal.go +++ b/internal/bigmap/bigmap_internal.go @@ -173,8 +173,9 @@ func (m *internalMap) Get(buf, key []byte) ([]byte, bool) { off := koff + uint32(data[koff]) + 1 vlen, vlenLen := binary.Uvarint(data[off:]) - start := off + uint32(vlenLen) + start := off + uint32(vlenLen) //nolint:gosec + //nolint:gosec return append(buf, data[start:start+uint32(vlen)]...), true } @@ -241,11 +242,11 @@ func (m *internalMap) growLocked(newSize uint64) { if m.hasValues { vlen, vlenLen := binary.Uvarint(seg[p:]) - p += vlenLen + int(vlen) + p += vlenLen + int(vlen) //nolint:gosec } slot := m.findSlotInSlice(key, newSlots, newH2Prime) - newSlots[slot] = entry{segment: uint32(segNum) + 1, offset: uint32(koff)} + newSlots[slot] = entry{segment: uint32(segNum) + 1, offset: uint32(koff)} //nolint:gosec } } @@ -291,7 +292,7 @@ func (m *internalMap) PutIfAbsent(ctx context.Context, key, value []byte) bool { m.segments = append(m.segments, current) } - koff := uint32(len(current)) + koff := uint32(len(current)) //nolint:gosec current = append(current, byte(len(key))) current = append(current, key...) @@ -310,6 +311,7 @@ func (m *internalMap) PutIfAbsent(ctx context.Context, key, value []byte) bool { m.count++ m.slots[slot] = entry{ + //nolint:gosec segment: uint32(len(m.segments)), // this is 1-based, 0==empty slot offset: koff, } diff --git a/internal/crypto/pb_key_derivers.go b/internal/crypto/pb_key_derivers.go index 2b664c027..d7673c867 100644 --- a/internal/crypto/pb_key_derivers.go +++ b/internal/crypto/pb_key_derivers.go @@ -30,7 +30,6 @@ func DeriveKeyFromPassword(password string, salt []byte, keySize int, algorithm return nil, errors.Errorf("unsupported key derivation algorithm: %v, supported algorithms %v", algorithm, supportedPBKeyDerivationAlgorithms()) } - //nolint:wrapcheck return kd.deriveKeyFromPassword(password, salt, keySize) } diff --git a/internal/providervalidation/providervalidation.go b/internal/providervalidation/providervalidation.go index 456b4abd9..37d2ebb80 100644 --- a/internal/providervalidation/providervalidation.go +++ b/internal/providervalidation/providervalidation.go @@ -306,7 +306,7 @@ func newConcurrencyTest(st []blob.Storage, prefix blob.ID, opt Options) *concurr func (c *concurrencyTest) dataFromSeed(seed int64, buf []byte) []byte { rnd := rand.New(rand.NewSource(seed)) //nolint:gosec - length := rnd.Int31n(int32(len(buf))) + length := rnd.Int31n(int32(len(buf))) //nolint:gosec result := buf[0:length] rnd.Read(result) diff --git a/internal/server/grpc_session.go b/internal/server/grpc_session.go index b10fb06a1..8cf8496d3 100644 --- a/internal/server/grpc_session.go +++ b/internal/server/grpc_session.go @@ -532,7 +532,7 @@ func makeEntryMetadataList(em []*manifest.EntryMetadata) []*grpcapi.ManifestEntr func makeEntryMetadata(em *manifest.EntryMetadata) *grpcapi.ManifestEntryMetadata { return &grpcapi.ManifestEntryMetadata{ Id: string(em.ID), - Length: int32(em.Length), + Length: int32(em.Length), //nolint:gosec ModTimeNanos: em.ModTime.UnixNano(), Labels: em.Labels, } diff --git a/repo/content/committed_read_manager.go b/repo/content/committed_read_manager.go index de76e878c..1dc8399fc 100644 --- a/repo/content/committed_read_manager.go +++ b/repo/content/committed_read_manager.go @@ -175,11 +175,11 @@ func (sm *SharedManager) attemptReadPackFileLocalIndex(ctx context.Context, pack return errors.Errorf("unable to find valid postamble in file %v", packFile) } - if uint32(offset) > postamble.localIndexOffset { + if uint32(offset) > postamble.localIndexOffset { //nolint:gosec return errors.Errorf("not enough data read during optimized attempt %v", packFile) } - postamble.localIndexOffset -= uint32(offset) + postamble.localIndexOffset -= uint32(offset) //nolint:gosec if uint64(postamble.localIndexOffset+postamble.localIndexLength) > uint64(payload.Length()) { // invalid offset/length diff --git a/repo/content/content_index_recovery.go b/repo/content/content_index_recovery.go index 31c08623e..a0ea90980 100644 --- a/repo/content/content_index_recovery.go +++ b/repo/content/content_index_recovery.go @@ -161,8 +161,8 @@ func decodePostamble(payload []byte) *packContentPostamble { return &packContentPostamble{ localIndexIV: iv, - localIndexLength: uint32(length), - localIndexOffset: uint32(off), + localIndexLength: uint32(length), //nolint:gosec + localIndexOffset: uint32(off), //nolint:gosec } } @@ -197,8 +197,8 @@ func (sm *SharedManager) appendPackFileIndexRecoveryData(mp format.MutableParame postamble := packContentPostamble{ localIndexIV: localIndexIV, - localIndexOffset: uint32(localIndexOffset), - localIndexLength: uint32(encryptedLocalIndex.Length()), + localIndexOffset: uint32(localIndexOffset), //nolint:gosec + localIndexLength: uint32(encryptedLocalIndex.Length()), //nolint:gosec } if _, err := encryptedLocalIndex.Bytes().WriteTo(output); err != nil { diff --git a/repo/content/content_manager.go b/repo/content/content_manager.go index ff37cf45d..5a0fa0a5c 100644 --- a/repo/content/content_manager.go +++ b/repo/content/content_manager.go @@ -309,10 +309,10 @@ func (bm *WriteManager) addToPackUnlocked(ctx context.Context, contentID ID, dat Deleted: isDeleted, ContentID: contentID, PackBlobID: pp.packBlobID, - PackOffset: uint32(pp.currentPackData.Length()), + PackOffset: uint32(pp.currentPackData.Length()), //nolint:gosec TimestampSeconds: bm.contentWriteTime(previousWriteTime), FormatVersion: byte(mp.Version), - OriginalLength: uint32(data.Length()), + OriginalLength: uint32(data.Length()), //nolint:gosec } if _, err := compressedAndEncrypted.Bytes().WriteTo(pp.currentPackData); err != nil { @@ -321,7 +321,7 @@ func (bm *WriteManager) addToPackUnlocked(ctx context.Context, contentID ID, dat } info.CompressionHeaderID = actualComp - info.PackedLength = uint32(pp.currentPackData.Length()) - info.PackOffset + info.PackedLength = uint32(pp.currentPackData.Length()) - info.PackOffset //nolint:gosec pp.currentPackItems[contentID] = info diff --git a/repo/content/index/index.go b/repo/content/index/index.go index a2ce21e74..9d23bd6cd 100644 --- a/repo/content/index/index.go +++ b/repo/content/index/index.go @@ -33,7 +33,7 @@ func Open(data []byte, closer func() error, v1PerContentOverhead func() int) (In switch h.version { case Version1: - return openV1PackIndex(h, data, closer, uint32(v1PerContentOverhead())) + return openV1PackIndex(h, data, closer, uint32(v1PerContentOverhead())) //nolint:gosec case Version2: return openV2PackIndex(data, closer) diff --git a/repo/content/index/index_builder.go b/repo/content/index/index_builder.go index d4f18164b..afabcd75c 100644 --- a/repo/content/index/index_builder.go +++ b/repo/content/index/index_builder.go @@ -165,7 +165,7 @@ func (b Builder) shard(maxShardSize int) []Builder { h := fnv.New32a() io.WriteString(h, k.String()) //nolint:errcheck - shard := h.Sum32() % uint32(numShards) + shard := h.Sum32() % uint32(numShards) //nolint:gosec result[shard][k] = v } diff --git a/repo/content/index/index_v1.go b/repo/content/index/index_v1.go index 45633e8ad..ba0e7ca87 100644 --- a/repo/content/index/index_v1.go +++ b/repo/content/index/index_v1.go @@ -284,8 +284,8 @@ func (b Builder) buildV1(output io.Writer) error { header := make([]byte, v1HeaderSize) header[0] = 1 // version header[1] = byte(b1.keyLength) - binary.BigEndian.PutUint16(header[2:4], uint16(b1.entryLength)) - binary.BigEndian.PutUint32(header[4:8], uint32(b1.entryCount)) + binary.BigEndian.PutUint16(header[2:4], uint16(b1.entryLength)) //nolint:gosec + binary.BigEndian.PutUint32(header[4:8], uint32(b1.entryCount)) //nolint:gosec if _, err := w.Write(header); err != nil { return errors.Wrap(err, "unable to write header") @@ -319,13 +319,13 @@ func (b *indexBuilderV1) prepareExtraData(allContents []Info) []byte { if it.PackBlobID != "" { if _, ok := b.packBlobIDOffsets[it.PackBlobID]; !ok { - b.packBlobIDOffsets[it.PackBlobID] = uint32(len(extraData)) + b.packBlobIDOffsets[it.PackBlobID] = uint32(len(extraData)) //nolint:gosec extraData = append(extraData, []byte(it.PackBlobID)...) } } } - b.extraDataOffset = uint32(v1HeaderSize + b.entryCount*(b.keyLength+b.entryLength)) + b.extraDataOffset = uint32(v1HeaderSize + b.entryCount*(b.keyLength+b.entryLength)) //nolint:gosec return extraData } diff --git a/repo/content/index/index_v2.go b/repo/content/index/index_v2.go index 494f3f4ca..fe6c72c3f 100644 --- a/repo/content/index/index_v2.go +++ b/repo/content/index/index_v2.go @@ -209,7 +209,7 @@ type v2HeaderInfo struct { } func (b *indexV2) getPackBlobIDByIndex(ndx uint32) blob.ID { - if ndx >= uint32(b.hdr.packCount) { + if ndx >= uint32(b.hdr.packCount) { //nolint:gosec return invalidBlobID } @@ -508,11 +508,11 @@ func (b Builder) buildV2(output io.Writer) error { header := make([]byte, v2IndexHeaderSize) header[0] = Version2 // version header[1] = byte(b2.keyLength) - binary.BigEndian.PutUint16(header[2:4], uint16(b2.entrySize)) - binary.BigEndian.PutUint32(header[4:8], uint32(b2.entryCount)) - binary.BigEndian.PutUint32(header[8:12], uint32(len(b2.packID2Index))) + binary.BigEndian.PutUint16(header[2:4], uint16(b2.entrySize)) //nolint:gosec + binary.BigEndian.PutUint32(header[4:8], uint32(b2.entryCount)) //nolint:gosec + binary.BigEndian.PutUint32(header[8:12], uint32(len(b2.packID2Index))) //nolint:gosec header[12] = byte(len(b2.uniqueFormatInfo2Index)) - binary.BigEndian.PutUint32(header[13:17], uint32(b2.baseTimestamp)) + binary.BigEndian.PutUint32(header[13:17], uint32(b2.baseTimestamp)) //nolint:gosec if _, err := w.Write(header); err != nil { return errors.Wrap(err, "unable to write header") @@ -564,15 +564,18 @@ func (b *indexBuilderV2) prepareExtraData(sortedInfos []Info) []byte { for _, it := range sortedInfos { if it.PackBlobID != "" { if _, ok := b.packBlobIDOffsets[it.PackBlobID]; !ok { - b.packBlobIDOffsets[it.PackBlobID] = uint32(len(extraData)) + b.packBlobIDOffsets[it.PackBlobID] = uint32(len(extraData)) //nolint:gosec extraData = append(extraData, []byte(it.PackBlobID)...) } } } - b.extraDataOffset = v2IndexHeaderSize // fixed header - b.extraDataOffset += uint32(b.entryCount * (b.keyLength + b.entrySize)) // entries index - b.extraDataOffset += uint32(len(b.packID2Index) * v2PackInfoSize) // pack information + b.extraDataOffset = v2IndexHeaderSize // fixed header + //nolint:gosec + b.extraDataOffset += uint32(b.entryCount * (b.keyLength + b.entrySize)) // entries index + //nolint:gosec + b.extraDataOffset += uint32(len(b.packID2Index) * v2PackInfoSize) // pack information + //nolint:gosec b.extraDataOffset += uint32(len(b.uniqueFormatInfo2Index) * v2FormatInfoSize) // formats return extraData @@ -628,7 +631,7 @@ func (b *indexBuilderV2) writeIndexValueEntry(w io.Writer, it Info) error { binary.BigEndian.PutUint32( buf[v2EntryOffsetTimestampSeconds:], - uint32(it.TimestampSeconds-b.baseTimestamp)) + uint32(it.TimestampSeconds-b.baseTimestamp)) //nolint:gosec // 4-7: pack offset bits 0..29 // flags: @@ -652,7 +655,7 @@ func (b *indexBuilderV2) writeIndexValueEntry(w io.Writer, it Info) error { // 14-15: pack ID (lower 16 bits)- index into Packs[] packBlobIndex := b.packID2Index[it.PackBlobID] - binary.BigEndian.PutUint16(buf[v2EntryOffsetPackBlobID:], uint16(packBlobIndex)) + binary.BigEndian.PutUint16(buf[v2EntryOffsetPackBlobID:], uint16(packBlobIndex)) //nolint:gosec // 16: format ID - index into Formats[] - 0 - present if not all formats are identical @@ -704,7 +707,7 @@ func openV2PackIndex(data []byte, closer func() error) (Index, error) { hi.entriesOffset = v2IndexHeaderSize hi.packsOffset = hi.entriesOffset + int64(hi.entryCount)*hi.entryStride - hi.formatsOffset = hi.packsOffset + int64(hi.packCount*v2PackInfoSize) + hi.formatsOffset = hi.packsOffset + int64(hi.packCount*v2PackInfoSize) //nolint:gosec // pre-read formats section formatsBuf, err := safeSlice(data, hi.formatsOffset, int(hi.formatCount)*v2FormatInfoSize) @@ -714,7 +717,7 @@ func openV2PackIndex(data []byte, closer func() error) (Index, error) { packIDs := make([]blob.ID, hi.packCount) - for i := range int(hi.packCount) { + for i := range int(hi.packCount) { //nolint:gosec buf, err := safeSlice(data, hi.packsOffset+int64(v2PackInfoSize*i), v2PackInfoSize) if err != nil { return nil, errors.Errorf("unable to read pack blob IDs section - 1") diff --git a/repo/ecc/ecc_rs_crc.go b/repo/ecc/ecc_rs_crc.go index 34110751c..1fd1e4562 100644 --- a/repo/ecc/ecc_rs_crc.go +++ b/repo/ecc/ecc_rs_crc.go @@ -174,7 +174,7 @@ func (r *ReedSolomonCrcECC) Encrypt(input gather.Bytes, _ []byte, output *gather defer inputBuffer.Close() inputBytes := inputBuffer.MakeContiguous(dataSizeInBlock * sizes.Blocks) - binary.BigEndian.PutUint32(inputBytes[:lengthSize], uint32(input.Length())) + binary.BigEndian.PutUint32(inputBytes[:lengthSize], uint32(input.Length())) //nolint:gosec copied := input.AppendToSlice(inputBytes[lengthSize:lengthSize]) // WriteBuffer does not clear the data, so we must clear the padding diff --git a/repo/splitter/splitter_buzhash32.go b/repo/splitter/splitter_buzhash32.go index c4ed4b004..c6fe666ea 100644 --- a/repo/splitter/splitter_buzhash32.go +++ b/repo/splitter/splitter_buzhash32.go @@ -85,9 +85,9 @@ func (rs *buzhash32Splitter) MaxSegmentSize() int { func newBuzHash32SplitterFactory(avgSize int) Factory { // avgSize must be a power of two, so 0b000001000...0000 // it just so happens that mask is avgSize-1 :) - mask := uint32(avgSize - 1) - maxSize := avgSize * 2 //nolint:mnd - minSize := avgSize / 2 //nolint:mnd + mask := uint32(avgSize - 1) //nolint:gosec + maxSize := avgSize * 2 //nolint:mnd + minSize := avgSize / 2 //nolint:mnd return func() Splitter { s := buzhash32.New() diff --git a/snapshot/snapshotfs/repofs.go b/snapshot/snapshotfs/repofs.go index a0baf002c..225b081ea 100644 --- a/snapshot/snapshotfs/repofs.go +++ b/snapshot/snapshotfs/repofs.go @@ -33,11 +33,11 @@ func (e *repositoryEntry) IsDir() bool { func (e *repositoryEntry) Mode() os.FileMode { switch e.metadata.Type { case snapshot.EntryTypeDirectory: - return os.ModeDir | os.FileMode(e.metadata.Permissions) + return os.ModeDir | os.FileMode(e.metadata.Permissions) //nolint:gosec case snapshot.EntryTypeSymlink: - return os.ModeSymlink | os.FileMode(e.metadata.Permissions) + return os.ModeSymlink | os.FileMode(e.metadata.Permissions) //nolint:gosec case snapshot.EntryTypeFile: - return os.FileMode(e.metadata.Permissions) + return os.FileMode(e.metadata.Permissions) //nolint:gosec case snapshot.EntryTypeUnknown: return 0 default: diff --git a/snapshot/snapshotfs/upload.go b/snapshot/snapshotfs/upload.go index 6670e1e3e..4fbef31c0 100644 --- a/snapshot/snapshotfs/upload.go +++ b/snapshot/snapshotfs/upload.go @@ -953,6 +953,7 @@ func (u *Uploader) processSingle( } } +//nolint:unparam func (u *Uploader) processEntryUploadResult(ctx context.Context, de *snapshot.DirEntry, err error, entryRelativePath string, parentDirBuilder *DirManifestBuilder, isIgnored bool, logDetail policy.LogDetail, logMessage string, t0 timetrack.Timer) error { if err != nil { u.reportErrorAndMaybeCancel(err, isIgnored, parentDirBuilder, entryRelativePath) diff --git a/snapshot/snapshotfs/upload_progress.go b/snapshot/snapshotfs/upload_progress.go index 0f486639b..f3352f93c 100644 --- a/snapshot/snapshotfs/upload_progress.go +++ b/snapshot/snapshotfs/upload_progress.go @@ -186,7 +186,7 @@ func (p *CountingUploadProgress) UploadedBytes(numBytes int64) { // EstimatedDataSize implements UploadProgress. func (p *CountingUploadProgress) EstimatedDataSize(numFiles int, numBytes int64) { atomic.StoreInt64(&p.counters.EstimatedBytes, numBytes) - atomic.StoreInt32(&p.counters.EstimatedFiles, int32(numFiles)) + atomic.StoreInt32(&p.counters.EstimatedFiles, int32(numFiles)) //nolint:gosec } // HashedBytes implements UploadProgress. diff --git a/tools/gettool/autodownload/autodownload.go b/tools/gettool/autodownload/autodownload.go index 9d022f4cf..f79dccef0 100644 --- a/tools/gettool/autodownload/autodownload.go +++ b/tools/gettool/autodownload/autodownload.go @@ -86,6 +86,7 @@ func untar(dir string, r io.Reader, stripPathComponents int) error { } case tar.TypeReg: + //nolint:gosec if ferr := createFile(target, os.FileMode(header.Mode), header.ModTime, tr); ferr != nil { return errors.Wrapf(ferr, "error creating file %v", target) } diff --git a/tools/gettool/checksums.txt b/tools/gettool/checksums.txt index dc207b231..177d7d6bb 100644 --- a/tools/gettool/checksums.txt +++ b/tools/gettool/checksums.txt @@ -7,12 +7,12 @@ https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0. https://github.com/gohugoio/hugo/releases/download/v0.113.0/hugo_extended_0.113.0_darwin-universal.tar.gz: 1557f896f34743d241e1aecab588be273dde59692b362a9f4488231a2595b2ae https://github.com/gohugoio/hugo/releases/download/v0.113.0/hugo_extended_0.113.0_linux-amd64.tar.gz: e04bccfa81df6c727f1c03bc858eb21d6f95123d311cafe245f4485d289123f3 https://github.com/gohugoio/hugo/releases/download/v0.113.0/hugo_extended_0.113.0_windows-amd64.zip: 3eabfbfad1431939058e6f7e76573c6bac1fee92f3a7b1ac5739c555940f0e0e -https://github.com/golangci/golangci-lint/releases/download/v1.59.0/golangci-lint-1.59.0-darwin-amd64.tar.gz: 418acf7e255ddc0783e97129c9b03d9311b77826a5311d425a01c708a86417e7 -https://github.com/golangci/golangci-lint/releases/download/v1.59.0/golangci-lint-1.59.0-darwin-arm64.tar.gz: 5f6a1d95a6dd69f6e328eb56dd311a38e04cfab79a1305fbf4957f4e203f47b6 -https://github.com/golangci/golangci-lint/releases/download/v1.59.0/golangci-lint-1.59.0-linux-amd64.tar.gz: 3b14a439f33c4fff83dbe0349950d984042b9a1feb6c62f82787b598fc3ab5f4 -https://github.com/golangci/golangci-lint/releases/download/v1.59.0/golangci-lint-1.59.0-linux-arm64.tar.gz: c57e6c0b0fa03089a2611dceddd5bc5d206716cccdff8b149da8baac598719a1 -https://github.com/golangci/golangci-lint/releases/download/v1.59.0/golangci-lint-1.59.0-linux-armv6.tar.gz: 93149e2d3b25ac754df9a23172403d8aa6d021a7e0d9c090a12f51897f68c9a0 -https://github.com/golangci/golangci-lint/releases/download/v1.59.0/golangci-lint-1.59.0-windows-amd64.zip: 3317d8a87a99a49a0a1321d295c010790e6dbf43ee96b318f4b8bb23eae7a565 +https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-darwin-amd64.tar.gz: faf60366f99bb4010b634a030c45eaf57baae6c0b7e10be151139871e3fef40e +https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-darwin-arm64.tar.gz: deb0fbd0b99992d97808614db1214f57d5bdc12b907581e2ef10d3a392aca11f +https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-linux-amd64.tar.gz: 4037af8122871f401ed874852a471e54f147ff8ce80f5a304e020503bdb806ef +https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-linux-arm64.tar.gz: 74782943b2d2edae1208be3701e0cafe62817ba90b9b4cc5ca52bdef26df12f9 +https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-linux-armv6.tar.gz: 9478a9cee4ea48c3025516472624f34f2e3a3406d3ec6642c8cef3cd8359aea9 +https://github.com/golangci/golangci-lint/releases/download/v1.60.3/golangci-lint-1.60.3-windows-amd64.zip: ebf030e0c25b99d1b5f301ec5f1ae0005c0d4f92d6ee79474ef170d69f390fef https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_arm64.tar.gz: 1f95e6561974f4766d8833438b646b06930563ca9867447ea03edb623d876c75 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_x86_64.tar.gz: 17ecad881a50e32f033da5a200c8417d37cae70f09e925645452937998aca506 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Linux_arm64.tar.gz: 8bf2a9b9e84498bfa239f2fe91b2d555642c87ab9d3f5d37f29e6e97116910a3 diff --git a/tools/tools.mk b/tools/tools.mk index 9cec93dc1..08fe5a5e5 100644 --- a/tools/tools.mk +++ b/tools/tools.mk @@ -102,7 +102,7 @@ retry:= endif # tool versions -GOLANGCI_LINT_VERSION=1.59.0 +GOLANGCI_LINT_VERSION=1.60.3 CHECKLOCKS_VERSION=e8c1fff214d0ecf02cfe5aa9c62d11174130c339 NODE_VERSION=20.15.1 HUGO_VERSION=0.113.0