Skip to content

Inconsistent GOPATH Setting in Devbox Go Examples #2640

@vn7n24fzkq

Description

@vn7n24fzkq

I'm using Devbox with Go and noticed an inconsistency that might confuse users.

In the documentation example on the website, the GOPATH is set to $PWD:

{
  "packages": [
    "go@latest"
  ],
  "env": {
    "GOPATH": "$PWD",
    "PATH": "$PATH:$PWD/bin"
  },
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {}
  }
}

However, this differs from the example in the GitHub repository, which sets GOPATH to $HOME/go/:
devbox.json

{
    "packages": [
        "go@1.19.8"
    ],
    "env": {
        "GOPATH": "$HOME/go/",
        "PATH": "$PATH:$HOME/go/bin"
    },
    "shell": {
        "init_hook": [
            "export \"GOROOT=$(go env GOROOT)\""
        ],
        "scripts": {
            "run_test": "go run main.go"
        }
    }
}

I think it would be helpful to align these examples or clarify the intended use cases, as the different GOPATH settings may cause confusion for users setting up their Go environments with Devbox.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions