s8sg / goflow

A Golang based high performance, scalable and distributed workflow framework
MIT License
1.18k stars 144 forks source link

Broken dependency tree when trying to use goflow for the first time #87

Open manitgupta opened 1 year ago

manitgupta commented 1 year ago

Hey All,

The imported the two dependencies for golang as follows -

import (
    "fmt"
    goflow "github.com/s8sg/goflow/v1"
    flow "github.com/s8sg/goflow/flow/v1"
)

and then go mod tidy, but I get the following errors -

❯ go mod tidy
go: finding module for package github.com/s8sg/goflow/v1
go: finding module for package github.com/s8sg/goflow/flow/v1
go: downloading github.com/s8sg/goflow v0.1.4
go: found github.com/s8sg/goflow/flow/v1 in github.com/s8sg/goflow v0.1.4
go: found github.com/s8sg/goflow/v1 in github.com/s8sg/goflow v0.1.4
go: downloading github.com/gin-gonic/gin v1.9.0
go: downloading github.com/mattn/go-isatty v0.0.18
go: downloading github.com/go-playground/validator/v10 v10.12.0
go: downloading github.com/bytedance/sonic v1.8.8
go: downloading github.com/pelletier/go-toml/v2 v2.0.7
go: downloading github.com/leodido/go-urn v1.2.3
go: finding module for package go.opentelemetry.io/otel/api/metric
go: finding module for package go.opentelemetry.io/otel/label
go: finding module for package go.opentelemetry.io/otel/api/trace
go: finding module for package go.opentelemetry.io/otel/api/global
go: github.com/GoogleCloudPlatform/spanner-migration-tool/workflows imports
    github.com/s8sg/goflow/v1 imports
    github.com/s8sg/goflow/runtime imports
    github.com/adjust/rmq/v4 imports
    github.com/go-redis/redis/v8 imports
    go.opentelemetry.io/otel/api/trace: module go.opentelemetry.io/otel@latest found (v1.19.0), but does not contain package go.opentelemetry.io/otel/api/trace
go: github.com/GoogleCloudPlatform/spanner-migration-tool/workflows imports
    github.com/s8sg/goflow/v1 imports
    github.com/s8sg/goflow/runtime imports
    github.com/adjust/rmq/v4 imports
    github.com/go-redis/redis/v8 imports
    go.opentelemetry.io/otel/label: module go.opentelemetry.io/otel@latest found (v1.19.0), but does not contain package go.opentelemetry.io/otel/label
go: github.com/GoogleCloudPlatform/spanner-migration-tool/workflows imports
    github.com/s8sg/goflow/v1 imports
    github.com/s8sg/goflow/runtime imports
    github.com/gin-gonic/gin imports
    github.com/gin-gonic/gin/binding imports
    github.com/ugorji/go/codec: ambiguous import: found package github.com/ugorji/go/codec in multiple modules:
    github.com/ugorji/go v1.1.4 (/Users/manitgupta/go/pkg/mod/github.com/ugorji/go@v1.1.4/codec)
    github.com/ugorji/go/codec v1.2.11 (/Users/manitgupta/go/pkg/mod/github.com/ugorji/go/codec@v1.2.11)
go: github.com/GoogleCloudPlatform/spanner-migration-tool/workflows imports
    github.com/s8sg/goflow/v1 imports
    github.com/s8sg/goflow/runtime imports
    github.com/adjust/rmq/v4 imports
    github.com/go-redis/redis/v8 imports
    github.com/go-redis/redis/v8/internal imports
    go.opentelemetry.io/otel/api/global: module go.opentelemetry.io/otel@latest found (v1.19.0), but does not contain package go.opentelemetry.io/otel/api/global
go: github.com/GoogleCloudPlatform/spanner-migration-tool/workflows imports
    github.com/s8sg/goflow/v1 imports
    github.com/s8sg/goflow/runtime imports
    github.com/adjust/rmq/v4 imports
    github.com/go-redis/redis/v8 imports
    github.com/go-redis/redis/v8/internal imports
    go.opentelemetry.io/otel/api/metric: module go.opentelemetry.io/otel@latest found (v1.19.0), but does not contain package go.opentelemetry.io/otel/api/metric

Looks like once of the dependencies of goflow is broken and importing a stale path of opentelemetry otel package which has been moved. Any suggestions on how to fix this?

khs1001 commented 11 months ago

How to solve it

FSSlc commented 3 months ago

In my case, some package need github.com/redis/go-redis/v9 , then I changed it to need github.com/go-redis/redis/v8, then solve this problem.