bmuschko / bmuschko/go-testing-frameworks

Build Fails Due to Dependency Version Mismatch

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
71
Forks
12
PR merge metrics
No merged PRs in 30d

Description

## Description

While rebuilding the project at commit `91889a8` using the latest version of Go, with Go's official recommendation to use Go modules for initialization and building, we found that the build process fails **due to mismatched module path**.

The following error log was produced during the build process:

```
go: found github.com/stretchr/testify/assert in github.com/stretchr/testify v1.9.0
go: github.com/bmuschko/go-testing-frameworks/calc tested by

github.com/bmuschko/go-testing-frameworks/calc.test imports

github.com/go-check/check: github.com/go-check/check@v0.0.0-20201130134442-10cb98267c6c: parsing go.mod:

module declares its path as: gopkg.in/check.v1

but was required as: github.com/go-check/check
```
## Result

The build fails with errors related to mismatched module path.

The error dependency is `github.com/go-check/check`.

## Reason

The error log suggests module path declaration **`gopkg.in/check.v1`** in go.mod, which is inconsistent with import path **`github.com/go-check/check`** .

## Proposed Solution

### Solution 1

To resolve this issue, we analyzed the project and identified the correct versions of the required dependencies.

The analysis shows that the correct version for the dependency **`github.com/go-check/check` is v0.0.0-20140401012214-6cce186aca8d**. This version has correct module path declaration.

Consider adopting this suggested version to prevent other developers from encountering build failures when constructing the project.

### Solution 2

To resolve this issue, we analyzed the project and identified the correct versions of the required dependencies.

The analysis shows that the correct version for the dependency **`replace github.com/go-check/check => gopkg.in/check.v1 v0.0.0-20201130134442-10cb98267c6c`**.

Consider adopting this suggested version to prevent other developers from encountering build failures when constructing the project.

**This information can be documented in the README.md file or another relevant location.**

## Additional Suggestions

**To ensure reproducible builds and align with the evolving trends of the Go programming language, it is recommended that the current project be migrated to the Go module mechanism.**

Updating to the go module mechanism allows for managing third-party dependency versions through the go.mod file, which provides a centralized and consistent way to specify dependency constraints.

We have generated a `go.mod` file with the correct versions of the third-party dependencies needed for this project.

The suggested `go.mod` file is as follows:

```
module github.com/bmuschko/go-testing-frameworks

go 1.25

replace github.com/go-resty/resty => github.com/go-resty/resty/v2 v2.0.1-0.20190912232600-30b66cd3a8e1

replace github.com/nats-io/nats-server => github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20250115203444-1f04395cdeb9

replace github.com/codegangsta/cli => github.com/urfave/cli v1.22.2

replace github.com/go-acme/lego => github.com/go-acme/lego/v4 v4.14.3-0.20231014231255-52990b3c9e88

replace github.com/klauspost/cpuid => github.com/klauspost/cpuid/v2 v2.2.12-0.20250627053433-fabe6222d225

replace github.com/go-chi/chi => github.com/go-chi/chi/v5 v5.2.2-0.20250218085932-d04703412f63

replace github.com/matttproud/golang_protobuf_extensions => github.com/matttproud/golang_protobuf_extensions/v2 v2.0.1-0.20240112091343-3664e70c352e

replace github.com/apparentlymart/go-cty => github.com/zclconf/go-cty v1.16.4-0.20250820220838-700a2bccfebd

replace github.com/golang-jwt/jwt => github.com/golang-jwt/jwt/v5 v5.0.1-0.20230913012927-1e76606719c8

replace github.com/tidwall/rtred => github.com/tidwall/rtree v0.1.0

replace github.com/apcera/nats => github.com/nats-io/nats.go v1.44.0

replace github.com/hetznercloud/hcloud-go => github.com/hetznercloud/hcloud-go/v2 v2.21.1-0.20250328103721-d630ac66cc8c

replace github.com/nwaples/rardecode => github.com/nwaples/rardecode/v2 v2.1.2-0.20250510235835-4f0a7507425f

replace github.com/ory/dockertest => github.com/ory/dockertest/v3 v3.11.1-0.20241022073224-45d199cba3e6

replace github.com/hashicorp/hcl => github.com/hashicorp/hcl/v2 v2.7.3-0.20201203155118-3b45fd43af62

replace github.com/lucas-clemente/quic-go => github.com/quic-go/quic-go v0.43.0

replace github.com/pierrec/lz4 => github.com/pierrec/lz4/v4 v4.0.2-0.20200921081804-2d1ec46c5dde

replace github.com/gocolly/colly => github.com/gocolly/colly/v2 v2.1.1-0.20210629084538-e2996f3c7a14

replace github.com/spdx/gordf => github.com/RishabhBhatnagar/gordf v0.0.0-20200722174040-6436660c0562

replace github.com/gobuffalo/tags => github.com/gobuffalo/tags/v3 v3.1.5-0.20230310221940-e0bbef314fc2

replace github.com/Masterminds/semver => github.com/Masterminds/semver/v3 v3.4.0

replace github.com/freddierice/go-losetup => github.com/freddierice/go-losetup/v2 v2.0.0

replace github.com/cespare/xxhash => github.com/cespare/xxhash/v2 v2.3.1-0.20240703180136-ab37246c889f

replace github.com/dnsimple/dnsimple-go => github.com/dnsimple/dnsimple-go/v6 v6.0.1-0.20250901073339-1a3af159dd15

replace github.com/minio/minio-go => github.com/minio/minio-go/v6 v6.0.49

replace github.com/Shopify/sarama => github.com/IBM/sarama v1.44.0

replace github.com/cockroachdb/cockroach-go => github.com/cockroachdb/cockroach-go/v2 v2.0.9-0.20201116071024-4565850eb143

replace github.com/lestrrat-go/option => github.com/lestrrat-go/option/v2 v2.0.0

replace github.com/bradleyjkemp/cupaloy => github.com/bradleyjkemp/cupaloy/v2 v2.8.0

replace github.com/MakeNowJust/heredoc => github.com/MakeNowJust/heredoc/v2 v2.0.2-0.20250105141631-096500dcd94b

replace github.com/expr-lang/expr => github.com/antonmedv/expr v1.15.2

replace github.com/robfig/cron => github.com/robfig/cron/v3 v3.0.0-20190210194926-1e507e218b68

replace github.com/DataDog/datadog-go => github.com/DataDog/datadog-go/v5 v5.6.1-0.20250516122251-1ed78034d06c

replace github.com/gobuffalo/validate => github.com/gobuffalo/validate/v3 v3.3.4-0.20220926044333-00f17732c63d

replace github.com/gophercloud/utils => github.com/gophercloud/utils/v2 v2.0.0-20250505075637-4ac8ddd08bb6

replace github.com/opensearch-project/opensearch-go => github.com/opensearch-project/opensearch-go/v2 v2.1.1-0.20221104231137-295124068fbc

replace github.com/throttled/throttled => github.com/throttled/throttled/v2 v2.8.1-0.20210705085214-c47c008fd9ce

replace github.com/cpuguy83/go-md2man => github.com/cpuguy83/go-md2man/v2 v2.0.5-0.20240912184238-4013a6973475

replace github.com/dgraph-io/badger => github.com/dgraph-io/badger/v2 v2.0.0-rc.2

replace github.com/jackc/pgproto3 => github.com/jackc/pgproto3/v2 v2.0.0-rc1

replace github.com/schollz/progressbar => github.com/schollz/progressbar/v3 v3.18.1-0.20250112172229-854f5d5e7abd

replace github.com/redis/rueidis => github.com/rueian/rueidis v0.0.75

replace github.com/kenshaw/snaker => github.com/knq/snaker v0.0.0-20200906011047-9a92cc127831

replace github.com/RishabhBhatnagar/gordf => github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb

replace github.com/coredns/caddy => github.com/mholt/caddy v1.0.0

replace github.com/checkpoint-restore/go-criu => github.com/checkpoint-restore/go-criu/v7 v7.2.1-0.20250605151100-9e012ba02db6

replace github.com/cactus/go-statsd-client => github.com/cactus/go-statsd-client/v5 v5.1.1-0.20250302214328-7ca8c68a60f4

replace github.com/mholt/archiver => github.com/mholt/archiver/v3 v3.4.1-0.20201027213513-b736c5128741

replace github.com/colinmarc/hdfs => github.com/colinmarc/hdfs/v2 v2.1.2-0.20200728121117-413b170cab02

replace github.com/invopop/jsonschema => github.com/alecthomas/jsonschema v0.0.0-20190119221338-bf1cc2205dbf

replace github.com/hamba/avro => github.com/hamba/avro/v2 v2.27.1-0.20250124045243-4ba9c7397e29

replace github.com/go-playground/form => github.com/go-playground/form/v4 v4.2.2-0.20250321145043-7de654522a68

replace github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.5.5-0.20250113160346-4555ec4d2286

replace github.com/felixge/fgprof => github.com/felixge/gprof v0.0.0-20200622150542-103a578dcb18

replace github.com/qiniu/api.v7 => github.com/qiniu/api.v7/v7 v7.8.2-0.20210128060800-9230d276291d

replace github.com/Jeffail/gabs => github.com/Jeffail/gabs/v2 v2.5.0

replace github.com/google/tcpproxy => github.com/inetaf/tcpproxy v0.0.0-20250222171855-c4b9df066048

replace github.com/jbenet/go-multihash => github.com/multiformats/go-multihash v0.1.0

replace github.com/apparentlymart/go-textseg => github.com/apparentlymart/go-textseg/v11 v11.0.0

replace github.com/nikolalohinski/gonja => github.com/nikolalohinski/gonja/v2 v2.0.0-20240630132959-241ec0ff581c

replace github.com/xo/terminfo => github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e

require github.com/onsi/gomega v1.38.2

require github.com/mattn/go-runewidth v0.0.15 // indirect

require github.com/mattn/go-isatty v0.0.20 // indirect

require github.com/smartystreets/goconvey v1.6.4

require github.com/kr/text v0.2.1-0.20210808194125-a988ae8c4d85 // indirect

require github.com/ToQoz/gopwt v0.1.1-0.20160907200209-0d07a59e17ef

require github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect

require github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect

require github.com/rivo/uniseg v0.4.7 // indirect

require github.com/go-check/check v0.0.0-20140401012214-6cce186aca8d

require github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect

require github.com/onsi/ginkgo v1.16.5

require github.com/k0kubun/pp v3.0.2-0.20191027095435-2a506fe9b857+incompatible // indirect

require github.com/kr/pretty v0.3.1 // indirect

require github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect

require github.com/mattn/go-colorable v0.1.14 // indirect

require github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db

require github.com/stretchr/testify v1.11.1

require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.28.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 // indirect
)

```

## Additional Information:

This issue was identified as part of our research project focused on automating the analysis of GOPATH projects to provide accurate dependency versions for seamless migration to Go Modules. We value your feedback and would appreciate any comments or suggestions regarding this approach.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure using the Go module setup described in the issue, then inspect the dependency declarations and imports involving github.com/go-check/check and gopkg.in/check.v1. Review README.md and go.mod as the relevant project entry points. Done means the project builds successfully with a consistent module path and the dependency migration scope is documented or implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.