# Request: better namespacing for vendor/ directory

**URL:** <https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782>\
**Category:** Technical Discussion\
**Created:** [April 2, 2026, 8:13pm UTC](https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782 "2026-04-02T20:13:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcandre](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/mcandre/32/3126_2.png) [@mcandre](https://forum.golangbridge.org/u/mcandre)\
**Post date:** [April 2, 2026, 8:13pm UTC](https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782/1 "2026-04-02T20:13:46Z")

</div>

The `vendor` directory that go mod targets for caching third party code, is unfortunately not programming language agnostic.

When Go and Rust are used in tandem, then go mod becomes confused. In situations where only Rust vendoring is applied, then go mod sees a `vendor` directory, assumes it is Go code, then aborts.

Please migrate to a language specific directory name, such as `vendor-go`.

As a workaround, use cargo primitives to customize the Rust vendor directory name.

Note that go mod currently lacks the ability to customize this name.

Cross post to Rust forum topic: [Request: better namespacing for vendor/ directory - The Rust Programming Language Forum](https://users.rust-lang.org/t/request-better-namespacing-for-vendor-directory/139374)

---

<div class="post-metadata">

**Author:** ![mje](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/mje/32/10284_2.png) [@mje](https://forum.golangbridge.org/u/mje)\
**Post date:** [April 3, 2026, 5:02pm UTC](https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782/2 "2026-04-03T17:02:17Z")

</div>

> [@mcandre](#):
>
> Please migrate to a language specific directory name, such as `vendor-go`.

Again, you’ll get better response if you file that at [Issues · golang/go · GitHub](https://github.com/golang/go/issues) . I’ve never seen any indication that anyone from the Go team visits this site.

---

<div class="post-metadata">

**Author:** ![Dean\_Davidson](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/dean_davidson/32/9685_2.png) [@Dean\_Davidson](https://forum.golangbridge.org/u/Dean_Davidson)\
**Post date:** [April 3, 2026, 6:32pm UTC](https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782/3 "2026-04-03T18:32:35Z")

</div>

To be fair, it’s already solved on the cargo side of things. Cargo supports vendoring into arbitrary folders:

> **[cargo vendor - The Cargo Book](https://doc.rust-lang.org/cargo/commands/cargo-vendor.html#examples)**

… which totally solves this problem. Also the idea that you would share a single top-level folder for a combination Rust/Go project is… interesting to say the least. I would contend that you should think about your folder/project structure a bit more and this is a non-issue.

---

<div class="post-metadata">

**Author:** ![Lslightly](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/lslightly/32/12993_2.png) [@Lslightly](https://forum.golangbridge.org/u/Lslightly)\
**Post date:** [April 7, 2026, 6:15am UTC](https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782/4 "2026-04-07T06:15:43Z")

</div>

Can `go mod vendor -o vendor-go` solve your problem?

`go help mod vendor` output that:

```auto
The -o flag causes vendor to create the vendor directory at the given
path instead of "vendor". The go command can only use a vendor directory
named "vendor" within the module root directory, so this flag is
primarily useful for other tools.

```

It seems that `-o` is used by other tools.

---

<div class="post-metadata">

**Author:** ![mcandre](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/mcandre/32/3126_2.png) [@mcandre](https://forum.golangbridge.org/u/mcandre)\
**Post date:** [April 7, 2026, 6:32pm UTC](https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782/5 "2026-04-07T18:32:20Z")

</div>

There should be a go.mod IaC setting to denote custom paths. Like cargo.

---

<div class="post-metadata">

**Author:** ![system](https://forum.golangbridge.org/uploads/default/original/2X/5/5ad234f7c3dbc68b6cc72d338ce4f2973d9fd81c.png) [@system](https://forum.golangbridge.org/u/system)\
**Post date:** [July 6, 2026, 6:32pm UTC](https://forum.golangbridge.org/t/request-better-namespacing-for-vendor-directory/41782/6 "2026-07-06T18:32:23Z")

</div>

Closed on July 6, 2026, 6:32pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
