Skip to content
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

v1.60.1+ on Go 1.23 No Longer Excludes Config of main redeclared in this block #4950

Closed
6 of 7 tasks
Justintime50 opened this issue Aug 23, 2024 · 3 comments
Closed
6 of 7 tasks
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@Justintime50
Copy link

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

Description of the problem

We have a repo of example snippets on using our API. The Go code lived alongside each other and all were runnable out of the box. We did have many snippets redeclaring the main block for that reason. We were able to get around this because they serve as a reference and aren't meant to be a module. We use golangci-lint and simply ignored those via our config (listed below). When we upgraded from Go 1.22 to Go 1.23 and golangci-lint 1.59.1 to golangci-lint 1.60.1, the tool no longer respects our config where we excluded the two rules that are now giving us grief: "other declaration of main" and "redeclared in this block". Prior to the upgrades, the linter ignored these lint issues and our linting passed. After the updates, linting fails.

Version of golangci-lint

$ golangci-lint --version
# Paste output here

Configuration

issues:
  exclude:
    - "other declaration of main"
    - "redeclared in this block"
    - "`main` is unused"
    - "github.com/EasyPost/easypost-go"
    - "undeclared name: `easypost`"
    - "expected 'package'"


linters-settings:
  staticcheck:
    checks:
      - all
      - '-SA1019'

Go environment

Unlinking /opt/homebrew/Cellar/[email protected]/1.22.6... 2 symlinks removed.
Linking /opt/homebrew/Cellar/go/1.23.0... 2 symlinks created.
jhammond@examples $ go version && go env
go version go1.23.0 darwin/arm64
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/jhammond/Library/Caches/go-build'
GOENV='/Users/jhammond/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/jhammond/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/jhammond/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.23.0/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.23.0/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.0'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/jhammond/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/jhammond/git/easypost/examples/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/fx/p1hr2vt53f7bx7qjrjr6zrdm0000gp/T/go-build3330066890=/tmp/go-build -gno-record-gcc-switches -fno-common'

Verbose output of running

INFO golangci-lint has version 1.60.1 built with go1.23.0 from 3298c104 on 2024-08-14T01:15:05Z 
INFO [config_reader] Config search paths: [./ /Users/jhammond/git/easypost/examples /Users/jhammond/git/easypost /Users/jhammond/git /Users/jhammond /Users /] 
INFO [config_reader] Used config file style_guides/golang/.golangci.yml 
INFO [lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused] 
INFO [loader] Go packages loading at mode 575 (deps|imports|name|types_sizes|compiled_files|exports_file|files) took 769.643583ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 6.422917ms 
INFO [linters_context/goanalysis] analyzers took 6.42557068s with top 10 stages: buildir: 3.944336256s, inspect: 175.726797ms, ctrlflow: 165.381498ms, fact_purity: 153.554003ms, printf: 147.117297ms, nilness: 146.814743ms, typedness: 124.248987ms, SA5012: 112.784251ms, tokenfileanalyzer: 30.75541ms, SA1008: 27.502755ms 
INFO [runner/max_from_linter] 27/77 issues from linter typecheck were hidden, use --max-issues-per-linter 
INFO [runner] Issues before processing: 13433, after processing: 50 
INFO [runner] Processors filtering stat (in/out): source_code: 50/50, path_shortener: 50/50, path_prettifier: 13398/13398, skip_dirs: 13398/13398, sort_results: 50/50, max_from_linter: 77/50, path_prefixer: 50/50, exclude-rules: 13398/13398, uniq_by_line: 13398/77, max_same_issues: 77/77, severity-rules: 50/50, skip_files: 13398/13398, identifier_marker: 13398/13398, invalid_issue: 13433/13398, autogenerated_exclude: 13398/13398, exclude: 13398/13398, nolint: 13398/13398, diff: 77/77, max_per_file_from_linter: 77/77, cgo: 13433/13433, filename_unadjuster: 13433/13433, fixer: 50/50 
INFO [runner] processing took 617.130956ms with stages: identifier_marker: 606.343291ms, path_prettifier: 6.545833ms, source_code: 1.284834ms, uniq_by_line: 404.084µs, nolint: 396.625µs, filename_unadjuster: 325.499µs, exclude: 321.125µs, skip_dirs: 303.791µs, cgo: 282.458µs, exclude-rules: 269.417µs, invalid_issue: 261.208µs, autogenerated_exclude: 241.75µs, path_shortener: 82.792µs, max_from_linter: 32.834µs, max_same_issues: 28.041µs, max_per_file_from_linter: 6.457µs, skip_files: 332ns, fixer: 209ns, sort_results: 167ns, diff: 125ns, path_prefixer: 42ns, severity-rules: 42ns 
INFO [runner] linters took 2.178907375s with stages: goanalysis_metalinter: 1.561670958s 
community/golang/concurrent_label_buy.go:1: : # github.com/EasyPost/examples/community/golang
community/golang/concurrent_refund.go:22:6: main redeclared in this block
        community/golang/concurrent_label_buy.go:24:6: other declaration of main
community/golang/concurrent_shipment_scanform.go:19:6: main redeclared in this block
        community/golang/concurrent_label_buy.go:24:6: other declaration of main
community/golang/webhook_handler.go:158:6: main redeclared in this block
        community/golang/concurrent_label_buy.go:24:6: other declaration of main (typecheck)
package main
official/docs/golang/current/addresses/create-and-verify.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/addresses
official/docs/golang/current/addresses/create.go:9:6: main redeclared in this block
        official/docs/golang/current/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/current/addresses/list.go:9:6: main redeclared in this block
        official/docs/golang/current/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/current/addresses/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/current/addresses/verify-failure.go:9:6: main redeclared in this block
        official/docs/golang/current/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/current/addresses/verify-param.go:9:6: main redeclared in this block
        official/docs/golang/current/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/current/addresses/verify-strict-param.go:9:6: main redeclared in this block
        official/docs/golang/current/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/current/addresses/verify.go:9:6: main redeclared in this block
        official/docs/golang/current/addresses/create-and-verify.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/batches/add-shipments.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/batches
official/docs/golang/current/batches/buy.go:9:6: main redeclared in this block
        official/docs/golang/current/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/current/batches/create.go:9:6: main redeclared in this block
        official/docs/golang/current/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/current/batches/label.go:9:6: main redeclared in this block
        official/docs/golang/current/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/current/batches/list.go:9:6: main redeclared in this block
        official/docs/golang/current/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/current/batches/remove-shipments.go:9:6: main redeclared in this block
        official/docs/golang/current/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/current/batches/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/current/batches/scan-forms.go:9:6: main redeclared in this block
        official/docs/golang/current/batches/add-shipments.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/billing/create-ep-credit-card.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/billing
official/docs/golang/current/billing/delete.go:9:6: main redeclared in this block
        official/docs/golang/current/billing/create-ep-credit-card.go:9:6: other declaration of main
official/docs/golang/current/billing/fund.go:7:6: main redeclared in this block
        official/docs/golang/current/billing/create-ep-credit-card.go:9:6: other declaration of main
official/docs/golang/current/billing/list.go:9:6: main redeclared in this block
        official/docs/golang/current/billing/create-ep-credit-card.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/carrier-accounts/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/carrier-accounts
official/docs/golang/current/carrier-accounts/delete.go:9:6: main redeclared in this block
        official/docs/golang/current/carrier-accounts/create.go:9:6: other declaration of main
official/docs/golang/current/carrier-accounts/list.go:9:6: main redeclared in this block
        official/docs/golang/current/carrier-accounts/create.go:9:6: other declaration of main
official/docs/golang/current/carrier-accounts/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/carrier-accounts/create.go:9:6: other declaration of main
official/docs/golang/current/carrier-accounts/update.go:9:6: main redeclared in this block
        official/docs/golang/current/carrier-accounts/create.go:9:6: other declaration of main
official/docs/golang/current/carrier-accounts/update.go:12:2: undefined: carrierAccount
official/docs/golang/current/carrier-accounts/update.go:28:18: declared and not used: err
official/docs/golang/current/carrier-accounts/update.go:28:56: undefined: carrierAccount
official/docs/golang/current/carrier-accounts/create.go:38:18: declared and not used: err (typecheck)
package example
official/docs/golang/current/child-users/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/child-users
official/docs/golang/current/child-users/delete.go:9:6: main redeclared in this block
        official/docs/golang/current/child-users/create.go:9:6: other declaration of main
official/docs/golang/current/child-users/list.go:9:6: main redeclared in this block
        official/docs/golang/current/child-users/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/claims/cancel.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/claims
official/docs/golang/current/claims/create.go:9:6: main redeclared in this block
        official/docs/golang/current/claims/cancel.go:9:6: other declaration of main
official/docs/golang/current/claims/list.go:9:6: main redeclared in this block
        official/docs/golang/current/claims/cancel.go:9:6: other declaration of main
official/docs/golang/current/claims/list.go:13:3: cannot use &easypost.ListOptions{…} (value of type *easypost.ListOptions) as *easypost.ListClaimsParameters value in argument to client.ListClaims
official/docs/golang/current/claims/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/claims/cancel.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/customs-infos/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/customs-infos
official/docs/golang/current/customs-infos/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/customs-infos/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/customs-items/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/customs-items
official/docs/golang/current/customs-items/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/customs-items/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/endshipper/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/endshipper
official/docs/golang/current/endshipper/create.go:9:6: main redeclared in this block
        official/docs/golang/current/endshipper/buy.go:9:6: other declaration of main
official/docs/golang/current/endshipper/list.go:9:6: main redeclared in this block
        official/docs/golang/current/endshipper/buy.go:9:6: other declaration of main
official/docs/golang/current/endshipper/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/endshipper/buy.go:9:6: other declaration of main
official/docs/golang/current/endshipper/update.go:9:6: main redeclared in this block
        official/docs/golang/current/endshipper/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/events/list.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/events
official/docs/golang/current/events/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/events/list.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/insurance/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/insurance
official/docs/golang/current/insurance/list.go:9:6: main redeclared in this block
        official/docs/golang/current/insurance/create.go:9:6: other declaration of main
official/docs/golang/current/insurance/refund.go:9:6: main redeclared in this block
        official/docs/golang/current/insurance/create.go:9:6: other declaration of main
official/docs/golang/current/insurance/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/insurance/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/orders/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/orders
official/docs/golang/current/orders/create.go:9:6: main redeclared in this block
        official/docs/golang/current/orders/buy.go:9:6: other declaration of main
official/docs/golang/current/orders/one-call-buy.go:9:6: main redeclared in this block
        official/docs/golang/current/orders/buy.go:9:6: other declaration of main
official/docs/golang/current/orders/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/orders/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/parcels/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/parcels
official/docs/golang/current/parcels/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/parcels/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/payloads/list.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/payloads
official/docs/golang/current/payloads/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/payloads/list.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/pickups/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/pickups
official/docs/golang/current/pickups/cancel.go:9:6: main redeclared in this block
        official/docs/golang/current/pickups/buy.go:9:6: other declaration of main
official/docs/golang/current/pickups/create.go:10:6: main redeclared in this block
        official/docs/golang/current/pickups/buy.go:9:6: other declaration of main
official/docs/golang/current/pickups/create.go:23:22: cannot use &minPickupTime (value of type *time.Time) as *easypost.DateTime value in struct literal
official/docs/golang/current/pickups/create.go:24:22: cannot use &maxPickupTime (value of type *time.Time) as *easypost.DateTime value in struct literal
official/docs/golang/current/pickups/list.go:9:6: main redeclared in this block
        official/docs/golang/current/pickups/buy.go:9:6: other declaration of main
official/docs/golang/current/pickups/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/pickups/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/rates/regenerate.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/rates
official/docs/golang/current/rates/retrieve-stateless.go:9:6: main redeclared in this block
        official/docs/golang/current/rates/regenerate.go:9:6: other declaration of main
official/docs/golang/current/rates/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/rates/regenerate.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/referral-customers
official/docs/golang/current/referral-customers/add-payment-method-with-credit-card.go:9:6: main redeclared in this block
        official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/current/referral-customers/create.go:9:6: main redeclared in this block
        official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/current/referral-customers/list.go:9:6: main redeclared in this block
        official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/current/referral-customers/refund-by-amount.go:9:6: main redeclared in this block
        official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/current/referral-customers/refund-by-payment-log.go:9:6: main redeclared in this block
        official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/current/referral-customers/update.go:7:6: main redeclared in this block
        official/docs/golang/current/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/refunds/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/refunds
official/docs/golang/current/refunds/list.go:9:6: main redeclared in this block
        official/docs/golang/current/refunds/create.go:9:6: other declaration of main
official/docs/golang/current/refunds/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/refunds/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/reports/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/reports
official/docs/golang/current/reports/list.go:9:6: main redeclared in this block
        official/docs/golang/current/reports/create.go:9:6: other declaration of main
official/docs/golang/current/reports/list.go:12:29: undefined: easypost.ListReportsOptions
official/docs/golang/current/reports/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/reports/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/scan-form/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/scan-form
official/docs/golang/current/scan-form/list.go:9:6: main redeclared in this block
        official/docs/golang/current/scan-form/create.go:9:6: other declaration of main
official/docs/golang/current/scan-form/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/scan-form/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/shipments/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/shipments
official/docs/golang/current/shipments/create.go:9:6: main redeclared in this block
        official/docs/golang/current/shipments/buy.go:9:6: other declaration of main
official/docs/golang/current/shipments/label.go:9:6: main redeclared in this block
        official/docs/golang/current/shipments/buy.go:9:6: other declaration of main
official/docs/golang/current/shipments/list.go:9:6: main redeclared in this block
        official/docs/golang/current/shipments/buy.go:9:6: other declaration of main
official/docs/golang/current/shipments/one-call-buy.go:9:6: main redeclared in this block
        official/docs/golang/current/shipments/buy.go:9:6: other declaration of main
official/docs/golang/current/shipments/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/shipments/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/smartrate
official/docs/golang/current/smartrate/retrieve-recommend-ship-date.go:9:6: main redeclared in this block
        official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go:9:6: other declaration of main
official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go:9:6: main redeclared in this block
        official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go:9:6: other declaration of main
official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go:13:3: unknown field OriginPostalCode in struct literal of type easypost.EstimateDeliveryDateForZipPairParams
official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-by.go:14:3: unknown field DestinationPostalCode in struct literal of type easypost.EstimateDeliveryDateForZipPairParams
official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go:9:6: main redeclared in this block
        official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go:9:6: other declaration of main
official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go:13:3: unknown field OriginPostalCode in struct literal of type easypost.RecommendShipDateForZipPairParams
official/docs/golang/current/smartrate/retrieve-standalone-smartrate-deliver-on.go:14:3: unknown field DestinationPostalCode in struct literal of type easypost.RecommendShipDateForZipPairParams
official/docs/golang/current/smartrate/retrieve-time-in-transit-statistics.go:9:6: main redeclared in this block
        official/docs/golang/current/smartrate/retrieve-estimated-delivery-date.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/trackers/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/trackers
official/docs/golang/current/trackers/list.go:9:6: main redeclared in this block
        official/docs/golang/current/trackers/create.go:9:6: other declaration of main
official/docs/golang/current/trackers/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/trackers/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/current/users/retrieve.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/users
official/docs/golang/current/users/update.go:9:6: main redeclared in this block
        official/docs/golang/current/users/retrieve.go:9:6: other declaration of main
official/docs/golang/current/users/update.go:12:2: undefined: user
official/docs/golang/current/users/update.go:15:20: cannot use "50.00" (untyped string constant) as *string value in struct literal
official/docs/golang/current/users/update.go:19:14: undefined: user (typecheck)
package example
official/docs/golang/current/webhooks/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/current/webhooks
official/docs/golang/current/webhooks/delete.go:9:6: main redeclared in this block
        official/docs/golang/current/webhooks/create.go:9:6: other declaration of main
official/docs/golang/current/webhooks/list.go:9:6: main redeclared in this block
        official/docs/golang/current/webhooks/create.go:9:6: other declaration of main
official/docs/golang/current/webhooks/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/current/webhooks/create.go:9:6: other declaration of main
official/docs/golang/current/webhooks/update.go:9:6: main redeclared in this block
        official/docs/golang/current/webhooks/create.go:9:6: other declaration of main
official/docs/golang/current/webhooks/update.go:12:37: not enough arguments in call to client.UpdateWebhook
        have (string)
        want (string, *easypost.CreateUpdateWebhookOptions) (typecheck)
package example
official/docs/golang/v2/addresses/create-and-verify.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/addresses
official/docs/golang/v2/addresses/create.go:9:6: main redeclared in this block
        official/docs/golang/v2/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/v2/addresses/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/v2/addresses/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/v2/addresses/verify-failure.go:9:6: main redeclared in this block
        official/docs/golang/v2/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/v2/addresses/verify-param.go:9:6: main redeclared in this block
        official/docs/golang/v2/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/v2/addresses/verify-strict-param.go:9:6: main redeclared in this block
        official/docs/golang/v2/addresses/create-and-verify.go:9:6: other declaration of main
official/docs/golang/v2/addresses/verify.go:9:6: main redeclared in this block
        official/docs/golang/v2/addresses/create-and-verify.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/batches/add-shipments.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/batches
official/docs/golang/v2/batches/buy.go:9:6: main redeclared in this block
        official/docs/golang/v2/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/v2/batches/create.go:9:6: main redeclared in this block
        official/docs/golang/v2/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/v2/batches/label.go:9:6: main redeclared in this block
        official/docs/golang/v2/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/v2/batches/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/v2/batches/remove-shipments.go:9:6: main redeclared in this block
        official/docs/golang/v2/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/v2/batches/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/batches/add-shipments.go:9:6: other declaration of main
official/docs/golang/v2/batches/scan-forms.go:9:6: main redeclared in this block
        official/docs/golang/v2/batches/add-shipments.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/billing/create-ep-credit-card.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/billing
official/docs/golang/v2/billing/delete.go:9:6: main redeclared in this block
        official/docs/golang/v2/billing/create-ep-credit-card.go:9:6: other declaration of main
official/docs/golang/v2/billing/fund.go:7:6: main redeclared in this block
        official/docs/golang/v2/billing/create-ep-credit-card.go:9:6: other declaration of main
official/docs/golang/v2/billing/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/billing/create-ep-credit-card.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/carbon-offset/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/carbon-offset
official/docs/golang/v2/carbon-offset/create.go:9:6: main redeclared in this block
        official/docs/golang/v2/carbon-offset/buy.go:9:6: other declaration of main
official/docs/golang/v2/carbon-offset/one-call-buy.go:9:6: main redeclared in this block
        official/docs/golang/v2/carbon-offset/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/carrier-accounts/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/carrier-accounts
official/docs/golang/v2/carrier-accounts/delete.go:9:6: main redeclared in this block
        official/docs/golang/v2/carrier-accounts/create.go:9:6: other declaration of main
official/docs/golang/v2/carrier-accounts/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/carrier-accounts/create.go:9:6: other declaration of main
official/docs/golang/v2/carrier-accounts/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/carrier-accounts/create.go:9:6: other declaration of main
official/docs/golang/v2/carrier-accounts/update.go:9:6: main redeclared in this block
        official/docs/golang/v2/carrier-accounts/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/child-users/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/child-users
official/docs/golang/v2/child-users/delete.go:9:6: main redeclared in this block
        official/docs/golang/v2/child-users/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/customs-infos/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/customs-infos
official/docs/golang/v2/customs-infos/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/customs-infos/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/customs-items/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/customs-items
official/docs/golang/v2/customs-items/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/customs-items/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/endshipper/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/endshipper
official/docs/golang/v2/endshipper/create.go:9:6: main redeclared in this block
        official/docs/golang/v2/endshipper/buy.go:9:6: other declaration of main
official/docs/golang/v2/endshipper/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/endshipper/buy.go:9:6: other declaration of main
official/docs/golang/v2/endshipper/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/endshipper/buy.go:9:6: other declaration of main
official/docs/golang/v2/endshipper/update.go:9:6: main redeclared in this block
        official/docs/golang/v2/endshipper/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/events/list.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/events
official/docs/golang/v2/events/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/events/list.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/insurance/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/insurance
official/docs/golang/v2/insurance/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/insurance/create.go:9:6: other declaration of main
official/docs/golang/v2/insurance/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/insurance/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/orders/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/orders
official/docs/golang/v2/orders/create.go:9:6: main redeclared in this block
        official/docs/golang/v2/orders/buy.go:9:6: other declaration of main
official/docs/golang/v2/orders/one-call-buy.go:9:6: main redeclared in this block
        official/docs/golang/v2/orders/buy.go:9:6: other declaration of main
official/docs/golang/v2/orders/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/orders/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/parcels/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/parcels
official/docs/golang/v2/parcels/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/parcels/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/payloads/list.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/payloads
official/docs/golang/v2/payloads/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/payloads/list.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/pickups/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/pickups
official/docs/golang/v2/pickups/cancel.go:9:6: main redeclared in this block
        official/docs/golang/v2/pickups/buy.go:9:6: other declaration of main
official/docs/golang/v2/pickups/create.go:10:6: main redeclared in this block
        official/docs/golang/v2/pickups/buy.go:9:6: other declaration of main
official/docs/golang/v2/pickups/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/pickups/buy.go:9:6: other declaration of main
official/docs/golang/v2/pickups/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/pickups/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/rates/regenerate.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/rates
official/docs/golang/v2/rates/retrieve-stateless.go:9:6: main redeclared in this block
        official/docs/golang/v2/rates/regenerate.go:9:6: other declaration of main
official/docs/golang/v2/rates/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/rates/regenerate.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/referral-customers/add-payment-method-with-bank-account.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/referral-customers
official/docs/golang/v2/referral-customers/add-payment-method-with-credit-card.go:9:6: main redeclared in this block
        official/docs/golang/v2/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/v2/referral-customers/create.go:9:6: main redeclared in this block
        official/docs/golang/v2/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/v2/referral-customers/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/v2/referral-customers/refund-by-amount.go:9:6: main redeclared in this block
        official/docs/golang/v2/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/v2/referral-customers/refund-by-payment-log.go:9:6: main redeclared in this block
        official/docs/golang/v2/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main
official/docs/golang/v2/referral-customers/update.go:7:6: main redeclared in this block
        official/docs/golang/v2/referral-customers/add-payment-method-with-bank-account.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/refunds/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/refunds
official/docs/golang/v2/refunds/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/refunds/create.go:9:6: other declaration of main
official/docs/golang/v2/refunds/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/refunds/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/reports/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/reports
official/docs/golang/v2/reports/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/reports/create.go:9:6: other declaration of main
official/docs/golang/v2/reports/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/reports/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/scan-form/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/scan-form
official/docs/golang/v2/scan-form/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/scan-form/create.go:9:6: other declaration of main
official/docs/golang/v2/scan-form/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/scan-form/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/shipments/buy.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/shipments
official/docs/golang/v2/shipments/create.go:9:6: main redeclared in this block
        official/docs/golang/v2/shipments/buy.go:9:6: other declaration of main
official/docs/golang/v2/shipments/label.go:9:6: main redeclared in this block
        official/docs/golang/v2/shipments/buy.go:9:6: other declaration of main
official/docs/golang/v2/shipments/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/shipments/buy.go:9:6: other declaration of main
official/docs/golang/v2/shipments/one-call-buy.go:9:6: main redeclared in this block
        official/docs/golang/v2/shipments/buy.go:9:6: other declaration of main
official/docs/golang/v2/shipments/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/shipments/buy.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/smartrate/retrieve-estimated-delivery-date.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/smartrate
official/docs/golang/v2/smartrate/retrieve-time-in-transit-statistics.go:9:6: main redeclared in this block
        official/docs/golang/v2/smartrate/retrieve-estimated-delivery-date.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/trackers/create.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/trackers
official/docs/golang/v2/trackers/list.go:9:6: main redeclared in this block
        official/docs/golang/v2/trackers/create.go:9:6: other declaration of main
official/docs/golang/v2/trackers/retrieve.go:9:6: main redeclared in this block
        official/docs/golang/v2/trackers/create.go:9:6: other declaration of main (typecheck)
package example
official/docs/golang/v2/users/retrieve.go:1: : # github.com/EasyPost/examples/official/docs/golang/v2/users
official/docs/golang/v2/users/update.go:9:6: main redeclared in this block
        official/docs/golang/v2/users/retrieve.go:9:6: other declaration of main (typecheck)
package example
INFO File cache stats: 50 entries of total size 19.4KiB 
INFO Memory: 31 samples, avg is 262.5MB, max is 448.5MB 
INFO Execution took 2.965316666s

A minimal reproducible example or link to a public repository

PR that failed here: EasyPost/examples#158

Validation

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

Supporter

@Justintime50 Justintime50 added the bug Something isn't working label Aug 23, 2024
Copy link

boring-cyborg bot commented Aug 23, 2024

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez ldez added question Further information is requested and removed bug Something isn't working labels Aug 23, 2024
@ldez
Copy link
Member

ldez commented Aug 23, 2024

Hello,

you checked the following box:

[x] Yes, I've read the typecheck section of the FAQ.

As explained inside the documentation referenced by this box, linters cannot perform the analysis when there are typecheck errors. This is not related to golangci-lint itself but to how the analysis system works inside Go tooling.

typecheck errors are reported in the same style as linter reports/issues but are completely different because they are related to compilation problems (typecheck is not a linter).

The change inside v1.60.1 was to avoid side effects: most linters are not able to perform the analysis when there are typecheck errors, but some users thought it was working to just skip typecheck errors.

To be more explicit, before this change, most linters simply did not produce any reports because of the presence of typecheck errors.

So typecheck errors cannot be ignored/skipped.

Duplicate of #4914

@ldez ldez closed this as completed Aug 23, 2024
@ldez ldez added the duplicate This issue or pull request already exists label Aug 23, 2024
@Justintime50
Copy link
Author

The FAQ did not capture the silent failing based on our use-case. The most recent update finally bubbled up this behavior which is why the issue was filed, we previously assumed linting was succeeding.

Thank you for clarifying, we've corrected our codebase.

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 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants