Repo github.com/influxdata/influxdb-client-go at version v2.2.2 uses replace directive to pin dependency github.com/deepmap/oapi-codegen to version baf7136.
According to Go Modules wikis, replace directives in modules other than the main module are ignored when building the main module.
It means such replace usage in dependency's go.mod cannot be inherited when building main module. In general, javadmohebbi/goNfCollector would indirectly depend on deepmap/oapi-codegen@v1.3.13 when building this module, which is different from the pinned version influxdata/influxdb-client-go needed.
Dependency line:
github.com/javadmohebbi/goNfCollector --> github.com/influxdata/influxdb-client-go --> github.com/deepmap/oapi-codegen
github.com/influxdata/influxdb-client-go v2.2.2 --> github.com/deepmap/oapi-codegen baf7136
https://github.com/influxdata/influxdb-client-go/blob/v2.2.2/go.mod#L14
Background
Repo
github.com/influxdata/influxdb-client-go
at versionv2.2.2
uses replace directive to pin dependencygithub.com/deepmap/oapi-codegen
to versionbaf7136
.According to Go Modules wikis,
replace
directives in modules other than themain module
are ignored when building the main module. It means such replace usage in dependency's go.mod cannot be inherited when building main module. In general,javadmohebbi/goNfCollector
would indirectly depend ondeepmap/oapi-codegen@v1.3.13
when building this module, which is different from the pinned versioninfluxdata/influxdb-client-go
needed.2. Add the same replace rule to your go.mod