mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-28 14:01:43 +01:00
coreos-go.eclass: Support setting the Go module download mode
Set COREOS_GO_MOD=vendor in the ebuild to use the project's vendor directory to satisfy dependencies. This variable should not be set for projects that don't use Go modules.
This commit is contained in:
parent
33dfb5126e
commit
ed1137f27d
@ -4,6 +4,15 @@
|
||||
# @ECLASS: coreos-go.eclass
|
||||
# @BLURB: utility functions for building Go binaries
|
||||
|
||||
# @ECLASS-VARIABLE: COREOS_GO_MOD
|
||||
# @DESCRIPTION:
|
||||
# Specify the module download mode for Go modules to use.
|
||||
#
|
||||
# Example:
|
||||
# @CODE
|
||||
# COREOS_GO_MOD=vendor
|
||||
# @CODE
|
||||
|
||||
# @ECLASS-VARIABLE: COREOS_GO_PACKAGE
|
||||
# @REQUIRED
|
||||
# @DESCRIPTION:
|
||||
@ -46,6 +55,7 @@ go_build() {
|
||||
${EGO} build -v \
|
||||
-p "$(makeopts_jobs)" \
|
||||
-ldflags "${GO_LDFLAGS} -extldflags '${LDFLAGS}'" \
|
||||
${COREOS_GO_MOD:+-mod "${COREOS_GO_MOD}"} \
|
||||
-o "${GOBIN}/${binary_name}" \
|
||||
"${package_name}"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user