How to pass Configuration parameter when we Go build?

I have different types of configuration parameters depending on the environment in an json file
e.g. staging, production, local

I am able to pass these parameters from Intellij Goland as enviroment in the Run/debug configuration
but not sure how to do it from terminal when I go build
Any help would be appreciated. Attached is the screen shot of Intellij


Try the go help build command:

$ go help build
usage: go build [-o output] [-i] [build flags] [packages]

1 Like

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