#Go.work (workspaces) hell πŸ”₯ for GO modules with utilities called by Dagger modules

1 messages Β· Page 1 of 1 (latest)

cerulean zephyr
#

Hey πŸ‘‹πŸ». I'm facing an issue with my mono repo that as it sounds, use go.work workspaces. Here's my actual go.work file. There are two go modules there that aren't Dagger modules, but instead simple/vanilla Go modules with reusable functions that I want to reuse in the other modules that are actual Dagger modules/functions.

go 1.21.7

toolchain go1.21.7

use (
    .
    ./gitlab-cicd-vars/dagger
    ./goreleaser/dagger
    ./terraform/dagger
    ./terratest/dagger
    ./tflint/dagger
    ./daggerx
    ./utils
)

These two are simple GO modules, and the daggerx one somehow isn't found when I'm tryng to call a function of one of the modules that uses it, or just by doing dagger develop on that module.

    ./daggerx #(it has a package pkg/args that I'm trying to reuse)
    ./utils

Here's the error:

      ┃ generating go module: goreleaser
      ┃ writing dagger.gen.go
      ┃ writing go.mod
      ┃ writing go.sum
      ┃ writing internal/dagger/dagger.gen.go
      ┃ running post-command: go mod tidy
      ┃ go: finding module for package github.com/excoriate/daggerverse/daggerx/pkg/args
      ┃ go: found github.com/excoriate/daggerverse/daggerx/pkg/args in github.com/excoriate/daggerverse/daggerx v0.0.0-20240425074853-01c88d723425
      ┃ go: finding module for package github.com/Excoriate/daggerverse/utils/pkg/slices
      ┃ go: GoReleaser imports
      ┃         github.com/excoriate/daggerverse/daggerx/pkg/args tested by
      ┃         github.com/excoriate/daggerverse/daggerx/pkg/args.test imports
      ┃         github.com/Excoriate/daggerverse/utils/pkg/slices: module github.com/Excoriate/daggerverse@latest found (v1.7.0), but does not contain pa
      ┃ thub.com/Excoriate/daggerverse/utils/pkg/slices

In the target module, I'm importing this package daggerArgs "github.com/excoriate/daggerverse/daggerx/pkg/args" . From the IDE perspective, no issues. :/