https://pantsbuild.org/ logo
#general
Title
# general
w

witty-byte-13646

01/03/2023, 7:15 PM
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

busy-vase-39202

01/03/2023, 7:34 PM
I don't personally know the answer, but suspect @fast-nail-55400 will...
w

witty-byte-13646

01/03/2023, 7:40 PM
Thanks Carina!
f

fast-nail-55400

01/03/2023, 7:49 PM
It is supported now. The docs are out of date.
(And if it doesn’t work, it would now be a regression.)
w

witty-byte-13646

01/03/2023, 7:52 PM
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

fast-nail-55400

01/03/2023, 8:11 PM
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

witty-byte-13646

01/03/2023, 8:15 PM
@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
3 Views