Go variables update

Hi all,
my laptop run on Ubuntu 16.04, and i would like to know to update that go variable : GB_PROJECT_DIR
because it contains a wrong path :frowning:
Thanks by advance for your help
@+Mat

Which configuration file sets this environment variable? It is not set systemwide by Ubuntu so you mus’ve changed some file to set it.

The variable is internal to gbs environment and autdetected from the current working directory. So there’s no way to change it (except for changing directory).

At least thats how I read the docs

Maybe -R?

$ gb help project
A gb project is defined as any directory that contains a src/ subdirectory.
gb automatically detects the root of the project by looking at the current
working directory and walking backwards until it finds a directory that
contains a src/ subdirectory.

In the event you wish to override this auto detection mechanism, the -R flag
can be used to supply a project root.

See http://getgb.io/docs/project for details
3 Likes

Thanks for your answers :slight_smile:
in fact, i’m coding in Go using intelliJ. My colleagues just tells me that i had to modify my IntelliJ settings.
In Files/Settings/Languages&Frameworks/Go :

  • uncheck the box called : Used GOPATH that’s defined in system environment
  • in Project GOPATH : add my project path
    that’s it :slight_smile:

Which in fact seems to have nothing to do with gb and its variables at all. Everyone on this thread thought you were using a terminal and some dumb up to semi-smart editor.

In an IDE there are often much much more things to consider than in such a basic setup your initial post implies.

you right, even if modifying IntelliJ settings are also modifying the GB_PROJECT_DIR value (–> gb env command result).
Sorry if was not precise enough :frowning:

Thanks for your answer Jakob.
I think that IntelliJ is overriding the auto detection mechanism !
By modifying IntelliJ settings, my problem has been solved.
Thank you.

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