workspace: pkg1 imports pkg2 imports pkg3

147 views
Skip to first unread message

Peter Kleiweg

unread,
Nov 2, 2025, 8:22:49 AMNov 2
to golang-nuts
I have tree packages I want to work on locally. pkg1 imports pkg2. pkg2 imports pkg3.

I have a file `go.work`:

    go 1.25.3
    use (
        ./pkg1
        ./pkg2
        ./pkg3
    )

When I build pkg2 it uses the local version of pkg3.

But when I build pkg1, it uses the local version of pkg2, but not the local version of pkg3.

How do I fix this?


I use 'go 'work

Roland Müller

unread,
Nov 17, 2025, 7:32:46 AMNov 17
to golang-nuts
Hello,

to check this you should provide the relevant import statements for the pkg{2,3} and the entries in the go.mod files of the packages.

There can be some mismatch.

BR,
Roland

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/23d0e48c-c012-430c-9ed2-800fb37d82acn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages