Makefile: make add EXTRA_GOFLAG to GOFLAGS #605

Merged
konrad merged 1 commits from jtojnar/api:extra-goflags into master 2020-07-04 16:55:53 +00:00
Contributor

Description

Some commands (go generate) only support taking GOFLAGS from the environment but setting GOFLAGS environment variable is ineffectual because the variable of the same name defined in the Makefile shadows it.

We also have a custom EXTRA_GOFLAGS variable but we only pass that to go build.

Let’s add EXTRA_GOFLAGS to the GOFLAGS variable in the Makefile to allow passing custom flags to Go through EXTRA_GOFLAGS environment variable.

Checklist

  • I added or improved tests
  • I added or improved docs for my feature
    • Swagger (including make do-the-swag)
    • Error codes
    • New config options
# Description Some commands (`go generate`) only support taking `GOFLAGS` from the environment but setting `GOFLAGS` environment variable is ineffectual because the variable of the same name defined in the Makefile shadows it. We also have a custom `EXTRA_GOFLAGS` variable but we only pass that to `go build`. Let’s add `EXTRA_GOFLAGS` to the `GOFLAGS` variable in the Makefile to allow passing custom flags to Go through `EXTRA_GOFLAGS` environment variable. # Checklist * [ ] I added or improved tests * [ ] I added or improved docs for my feature * [ ] Swagger (including `make do-the-swag`) * [ ] Error codes * [ ] New config options
jtojnar added 1 commit 2020-07-04 16:47:09 +00:00
continuous-integration/drone/pr Build is passing Details
ee2c70e6a2
Makefile: make add EXTRA_GOFLAG to GOFLAGS
Some commands (`go generate`) only support taking `GOFLAGS` from the environment
but setting `GOFLAGS` environment variable is ineffectual because the variable
of the same name defined in the Makefile shadows it.

We also have a custom `EXTRA_GOFLAGS` variable but we only pass that to `go build`.

Let’s add `EXTRA_GOFLAGS` to the `GOFLAGS` variable in the Makefile to allow passing
custom flags to Go through `EXTRA_GOFLAGS` environment variable.
konrad approved these changes 2020-07-04 16:49:03 +00:00
konrad left a comment
Owner

I'll merge once CI passes.

I'll merge once CI passes.
konrad merged commit 158d98c2bd into master 2020-07-04 16:55:53 +00:00
jtojnar deleted branch extra-goflags 2020-07-04 17:16:42 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#605
No description provided.