we’ve been running into some issues around replace
in go.mod
and GOPRIVATE
, where we’d really like GOPRIVATE
to be set per-repo using something like a .env
file or similar, rather than global per-user. is there a good way to do this that doesn’t require a bunch of messing around? or is there a nice way to put in a feature request to the go team for .env
support?
suggestions appreciated!
Maybe you can consider a better IDE.
Goland, for example, handles different ENVs for different projects.
not really a viable option in a mixed team where we try not to be prescriptive about the tools a team uses, as that’s jerk behaviour. and also you can pry zed from my cold dead hands.
plus, in general, forcing use of a specific IDE to get reasonable behaviour isn’t very good design methodology for a language in general. I’m looking for something that’ll work regardless of the development environment, not just for a tiny subset of its developers. we want our code to function with a simple git clone && go build
. starting to seem like there’s just not a great solution, unfortunately.
What nonsense are you talking about? I’m talking about the IDE solution, which is a solution for individual developers, which is an option. As you said, if you don’t have to dictate what tools the team uses, then it’s up to him to find a solution to the problem.
If you are the leader of the team, then you should give several how-to guidelines for the team members to choose from. In the same way, if he is unwilling to adopt your solution, it is his business. You are not their babysitter, they will take care of these things, trust them.
This problem cannot be solved unless you write a set of cli (e.g. wrapping go, reading the git configuration of the current directory, and then automatically setting environment variables based on a configuration file). But this kind of wrapper is not easy to use, I have seen garbage stuff that wraps git tools, and it really doesn’t work.
In my opinion, in order to facilitate my personal development efficiency, I am naturally willing to use a more convenient way to deal with this kind of thing that I don’t want to worry too much about.