Hi All! I'm new to pants and hoping to onboard it ...
# general
w
Hi All! I'm new to pants and hoping to onboard it to my team. I'm looking to create a multi-module monorepo with Golang. I saw the docs banner saying you only support single module repos but the linked issue seems to be closed. Is multi module Golang now supported with pants? I'm sorry if I missed the answer somewhere in the docs or PR.
b
I don't personally know the answer, but suspect @fast-nail-55400 will...
w
Thanks Carina!
f
It is supported now. The docs are out of date.
(And if it doesn’t work, it would now be a regression.)
w
Thanks @fast-nail-55400. I'm having trouble using the replace clause in the go.mod file I tried with a go.work file as well. Do I have to manually define the path to neighboring modules in my BUILD file?
This is my current directory layout oatmeal needs to be able to access banana and honey
Copy code
src
├── go
│   ├── go_modules
│   │   ├── banana
│   │   │   ├── banana.go
│   │   │   ├── banna_test.go
│   │   │   ├── BUILD
│   │   │   └── go.mod
│   │   └── honey
│   │       ├── BUILD
│   │       ├── go.mod
│   │       ├── honey.go
│   │       └── honey_test.go
│   ├── go.work
│   └── oatmeal
│       ├── BUILD
│       ├── go.mod
│       ├── go.sum
│       └── main.go
f
Replace directives like that are not supported yet, nor is
go.work
workspaces. You would have to have each module consume each other as if they were a third-party module.
i.e., tag a release in your repository and have it consumed that way.
There is no timeframe for go.work support currently because there is no one actively working on the Go backend.
also fyi, if you are interested in that support and are willing to put, or arrange, some development effort into Pants, let us know and we can mentor someone on what to change.
w
@fast-nail-55400 Thanks for you help. This might be something I'm interested in. Please give me a week to look through the code base then I'll slack you directly if I feel I'm able to contribute
👍 1