Changeset View
Changeset View
Standalone View
Standalone View
documentation/content/en/books/porters-handbook/uses/chapter.adoc
Show First 20 Lines • Show All 513 Lines • ▼ Show 20 Lines | |||||
==== | ==== | ||||
Possible arguments: (none), `modules`, `no_targets`, `run` | Possible arguments: (none), `modules`, `no_targets`, `run` | ||||
Sets default values and targets used to build Go software. A build dependency on the Go compiler port selected via `GO_PORT` is added. By default the build is performed in GOPATH mode. If Go software uses modules, the modules-aware mode can be switched on with `modules` argument. `no_targets` will setup build environment like `GO_ENV`, `GO_BUILDFLAGS` but skip creating `post-extract` and `do-{build,install,test}` targets. `run` will also add a run dependency on what is in `GO_PORT`. | Sets default values and targets used to build Go software. A build dependency on the Go compiler port selected via `GO_PORT` is added. By default the build is performed in GOPATH mode. If Go software uses modules, the modules-aware mode can be switched on with `modules` argument. `no_targets` will setup build environment like `GO_ENV`, `GO_BUILDFLAGS` but skip creating `post-extract` and `do-{build,install,test}` targets. `run` will also add a run dependency on what is in `GO_PORT`. | ||||
The build process is controlled by several variables: | The build process is controlled by several variables: | ||||
`GO_MODULE`:: | |||||
The name of the application module as specified by `module` directive in `go.mod`. In most cases, this is the only requred variable for ports that use Go modules. | |||||
`GO_PKGNAME`:: | `GO_PKGNAME`:: | ||||
The name of the Go package when building in GOPATH mode. This is the directory that will be created in `${GOPATH}/src`. If not set explicitly and `GH_SUBDIR` or `GL_SUBDIR` is present, `GO_PKGNAME` will be inferred from it. It is not needed when building in modules-aware mode. | The name of the Go package when building in GOPATH mode. This is the directory that will be created in `${GOPATH}/src`. If not set explicitly and `GH_SUBDIR` or `GL_SUBDIR` is present, `GO_PKGNAME` will be inferred from it. It is not needed when building in modules-aware mode. | ||||
`GO_TARGET`:: | `GO_TARGET`:: | ||||
The packages to build. The default value is `${GO_PKGNAME}`. `GO_TARGET` can also be a tuple in the form `package:path` where path can be either a simple filename or a full path starting with `${PREFIX}`. | The packages to build. The default value is `${GO_PKGNAME}`. `GO_TARGET` can also be a tuple in the form `package:path` where path can be either a simple filename or a full path starting with `${PREFIX}`. | ||||
`GO_TESTTARGET`:: | `GO_TESTTARGET`:: | ||||
The packages to test. The default value is `./...` (the current package and all subpackages). | The packages to test. The default value is `./...` (the current package and all subpackages). | ||||
▲ Show 20 Lines • Show All 1,135 Lines • Show Last 20 Lines |