Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Panic: protogetter: package "contracts" (isInitialPkg: true, needAnalyzeSource: true): runtime error: index out of range [4] with length 4 #5737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 of 7 tasks
olegrok opened this issue Apr 15, 2025 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@olegrok
Copy link

olegrok commented Apr 15, 2025

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

How did you install golangci-lint?

Official binary

Description of the problem

Version of golangci-lint

$ golangci-lint --version
# Paste output here

Configuration

version: "2"
run:
  build-tags:
    - test
    - goexperiment.synctest
linters:
  default: "all"
  settings:
    revive:
      enable-all-rules: false
      rules:
        - name: atomic
        - name: banned-characters
        - name: blank-imports
        - name: call-to-gc
        - name: comments-density
        - name: constant-logical-expr
        - name: context-as-argument
        - name: context-keys-type
        - name: datarace
        - name: defer
        - name: dot-imports
        - name: duplicated-imports
        - name: early-return
        - name: empty-block
        - name: empty-lines
        - name: enforce-map-style
        - name: enforce-repeated-arg-type-style
        - name: enforce-slice-style
        - name: error-naming
        - name: error-return
        - name: error-strings
        - name: errorf
        - name: file-header
        - name: file-length-limit
        - name: filename-format
        - name: get-return
        - name: identical-branches
        - name: if-return
        - name: imports-blocklist
        - name: increment-decrement
        - name: indent-error-flow
        - name: modifies-parameter
        - name: modifies-value-receiver
        - name: optimize-operands-order
        - name: package-comments
        - name: range-val-address
        - name: range-val-in-closure
        - name: range
        - name: redefines-builtin-id
        - name: redundant-build-tag
        - name: redundant-test-main-exit
        - name: string-format
        - name: string-of-int
        - name: struct-tag
        - name: superfluous-else
        - name: time-equal
        - name: time-naming
        - name: unchecked-type-assertion
        - name: unconditional-recursion
        - name: unhandled-error
        - name: unnecessary-stmt
        - name: unreachable-code
        - name: use-any
        - name: use-errors-new
        - name: useless-break
        - name: var-declaration
        - name: waitgroup-by-value
    gosec:
      excludes:
        - G115
    govet:
      disable:
        - fieldalignment
        - shadow
      enable-all: true
    lll:
      # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
      line-length: 120
      # tab width in spaces. Default to 1.
      tab-width: 4
    testifylint:
      enable-all: true
  exclusions:
    generated: lax
    presets:
      - comments
      - common-false-positives
      - legacy
      - std-error-handling
    rules:
      - linters:
          - lll
        source: ^// @(component|componentprop)
      - linters:
          - lll
        path: (nil/services/cliservice/block_format_test.go|nil/services/cliservice/block.go)
      - linters:
          - lll
        path: nil/internal/abi/abi_test.go
        source: "^//\treceipt{status=1 cgas=23949"
      - linters:
          - lll
        path: nil/services/synccommittee/prover/internal/constants/proof_producer_codes.go
        source: ^// https://github.com/NilFoundation/placeholder/
      - linters:
          - lll
        path: nil/services/synccommittee/core/reset/resetter.go
        source: "^\t\t// https://www.notion.so/nilfoundation/"
    paths:
      - clickhouse
      - third_party$
      - builtin$
      - examples$
issues:
  # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  max-issues-per-linter: 0
  # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  max-same-issues: 0
formatters:
  enable:
    - gci
    - gofmt
    - gofumpt
    - goimports
  exclusions:
    generated: lax
    paths:
      - clickhouse
      - third_party$
      - builtin$
      - examples$

Go environment

$ go version && go env
# paste output here

Verbose output of running

~/Downloads/golangci-lint-2.1.1-linux-amd64/golangci-lint run -v
INFO golangci-lint has version 2.1.1 built with go1.24.2 from 93dabf90 on 2025-04-12T18:19:05Z 
INFO [config_reader] Config search paths: [./ /home/oleg/Projects/toy-cluster /home/oleg/Projects /home/oleg /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO maxprocs: Leaving GOMAXPROCS=32: CPU quota undefined 
INFO [goenv] Read go env for 4.72751ms: map[string]string{"GOCACHE":"/tmp/sha256-brU97FtvJ1rRDrgBvWNdJgVgSICeV2R3CQeLR/u1lNo=/go-cache", "GOROOT":"/nix/store/g29rrn8qqlg4yjqv543ryrkimr7fk43h-go-1.24.1/share/go"} 
INFO [lintersdb] Active 108 linters: [asasalint asciicheck bidichk bodyclose canonicalheader containedctx contextcheck copyloopvar cyclop decorder depguard dogsled dupl dupword durationcheck err113 errcheck errchkjson errname errorlint exhaustive exhaustruct exptostd fatcontext forbidigo forcetypeassert funcorder funlen gci ginkgolinter gocheckcompilerdirectives gochecknoglobals gochecknoinits gochecksumtype gocognit goconst gocritic gocyclo godot godox gofmt gofumpt goheader goimports gomoddirectives gomodguard goprintffuncname gosec gosmopolitan govet grouper iface importas inamedparam ineffassign interfacebloat intrange ireturn lll loggercheck maintidx makezero mirror misspell mnd musttag nakedret nestif nilerr nilnesserr nilnil nlreturn noctx nolintlint nonamedreturns nosprintfhostport paralleltest perfsprint prealloc predeclared promlinter protogetter reassign recvcheck revive rowserrcheck sloglint spancheck sqlclosecheck staticcheck tagalign tagliatelle testableexamples testifylint testpackage thelper tparallel unconvert unparam unused usestdlibvars usetesting varnamelen wastedassign whitespace wrapcheck wsl zerologlint] 
INFO [loader] Using build tags: [test goexperiment.synctest] 
INFO [loader] Go packages loading at mode 8767 (types_sizes|compiled_files|exports_file|imports|name|deps|files) took 1.281494835s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 20.523496ms 
INFO [linters_context] importas settings found, but no aliases listed. List aliases under alias: key. 
INFO [linters_context/goanalysis] analyzers took 7m30.179039496s with top 10 stages: buildir: 24.865072194s, unparam: 14.509291309s, wastedassign: 13.507138262s, the_only_name: 11.799816536s, goimports: 10.632861802s, exhaustruct: 9.422788116s, gosec: 8.674595027s, wsl: 8.184590458s, dupl: 6.662511043s, gocritic: 6.610217746s 
ERRO [runner] Panic: protogetter: package "contracts" (isInitialPkg: true, needAnalyzeSource: true): runtime error: index out of range [4] with length 4: goroutine 41545 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x5e
github.com/golangci/golangci-lint/v2/pkg/goanalysis.(*action).analyzeSafe.func1()
	github.com/golangci/golangci-lint/v2/pkg/goanalysis/runner_action.go:50 +0x257
panic({0x157ece0?, 0xc000560450?})
	runtime/panic.go:792 +0x132
github.com/ghostiam/protogetter.(*processor).process(0xc013cd9790, {0x1b367d8?, 0xc00b7bb900})
	github.com/ghostiam/[email protected]/processor.go:111 +0xbbd
github.com/ghostiam/protogetter.Process(0x1474a80?, 0xc0114e8d50?, {0x1b367d8?, 0xc00b7bb900?}, 0x7fffb02bb300?)
	github.com/ghostiam/[email protected]/processor.go:29 +0x72
github.com/ghostiam/protogetter.analyse(0xc0179bed20, 0xc00b251970, {0x1b367d8, 0xc00b7bb900}, 0xc000358500)
	github.com/ghostiam/[email protected]/protogetter.go:140 +0x9e
github.com/ghostiam/protogetter.Run.func1({0x1b367d8?, 0xc00b7bb900?})
	github.com/ghostiam/[email protected]/protogetter.go:122 +0x4c
golang.org/x/tools/go/ast/inspector.(*Inspector).Preorder(0xc013cd9ab8, {0xc013cd9ad0?, 0x2781c60?, 0xc00016e340?}, 0xc013cd9b50)
	golang.org/x/[email protected]/go/ast/inspector/inspector.go:115 +0x91
github.com/ghostiam/protogetter.Run(0xc0179bed20, 0xc000358500)
	github.com/ghostiam/[email protected]/protogetter.go:121 +0x6ca
github.com/ghostiam/protogetter.NewAnalyzer.func1(0x146d3c0?)
	github.com/ghostiam/[email protected]/protogetter.go:31 +0x17
github.com/golangci/golangci-lint/v2/pkg/goanalysis.(*action).analyze.func3(...)
	github.com/golangci/golangci-lint/v2/pkg/goanalysis/runner_checker.go:182
github.com/golangci/golangci-lint/v2/pkg/goanalysis.(*action).analyze(0xc006041f60)
	github.com/golangci/golangci-lint/v2/pkg/goanalysis/runner_checker.go:208 +0xb62
github.com/golangci/golangci-lint/v2/pkg/timeutils.(*Stopwatch).TrackStage(0xc00192d810, {0x1655892, 0xb}, 0xc004ff1748)
	github.com/golangci/golangci-lint/v2/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/v2/pkg/goanalysis.(*action).analyzeSafe(0xc004a24c60?)
	github.com/golangci/golangci-lint/v2/pkg/goanalysis/runner_action.go:54 +0x71
github.com/golangci/golangci-lint/v2/pkg/goanalysis.(*loadingPackage).analyze.func2(0xc006041f60)
	github.com/golangci/golangci-lint/v2/pkg/goanalysis/runner_loadingpackage.go:86 +0xa5
created by github.com/golangci/golangci-lint/v2/pkg/goanalysis.(*loadingPackage).analyze in goroutine 1586
	github.com/golangci/golangci-lint/v2/pkg/goanalysis/runner_loadingpackage.go:81 +0x1e9 
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: protogetter: package "contracts" (isInitialPkg: true, needAnalyzeSource: true): runtime error: index out of range [4] with length 4 
INFO [runner/exclusion_paths] Skipped 0 issues by pattern "examples$" 
INFO [runner/exclusion_paths] Skipped 0 issues by pattern "clickhouse" 
INFO [runner/exclusion_paths] Skipped 0 issues by pattern "third_party$" 
INFO [runner/exclusion_paths] Skipped 0 issues by pattern "builtin$" 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "^\t\t// https://www.notion.so/nilfoundation/", Path: "nil/services/synccommittee/core/reset/resetter.go", Linters: "lll"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "clickhouse", Linters: "gci, gofmt, gofumpt, goimports"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "builtin$", Linters: "gci, gofmt, gofumpt, goimports"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "examples$", Linters: "gci, gofmt, gofumpt, goimports"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "^// @(component|componentprop)", Linters: "lll"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "(nil/services/cliservice/block_format_test.go|nil/services/cliservice/block.go)", Linters: "lll"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "^//\treceipt{status=1 cgas=23949", Path: "nil/internal/abi/abi_test.go", Linters: "lll"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "^// https://github.com/NilFoundation/placeholder/", Path: "nil/services/synccommittee/prover/internal/constants/proof_producer_codes.go", Linters: "lll"] 
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "third_party$", Linters: "gci, gofmt, gofumpt, goimports"] 
INFO [runner] processing took 28.35µs with stages: exclusion_rules: 17.234µs, exclusion_paths: 9.647µs, max_same_issues: 265ns, path_absoluter: 216ns, nolint_filter: 174ns, max_per_file_from_linter: 113ns, diff: 110ns, filename_unadjuster: 109ns, source_code: 89ns, max_from_linter: 85ns, path_relativity: 58ns, invalid_issue: 30ns, fixer: 30ns, path_shortener: 29ns, path_prettifier: 28ns, cgo: 27ns, generated_file_filter: 27ns, severity-rules: 27ns, uniq_by_line: 26ns, sort_results: 26ns 
INFO [runner] linters took 3.423133128s with stages: goanalysis_metalinter: 3.4230711s 
ERRO Running error: can't run linter goanalysis_metalinter
goanalysis_metalinter: protogetter: package "contracts" (isInitialPkg: true, needAnalyzeSource: true): runtime error: index out of range [4] with length 4 
INFO Memory: 49 samples, avg is 1018.3MB, max is 2865.2MB 
INFO Execution took 4.734440881s

A minimal reproducible example or link to a public repository

// add your code here

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

@olegrok olegrok added the bug Something isn't working label Apr 15, 2025
@ldez ldez added duplicate This issue or pull request already exists and removed bug Something isn't working labels Apr 15, 2025
@ldez
Copy link
Member

ldez commented Apr 15, 2025

duplicate of #5726

@ldez ldez closed this as completed Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants