Skip to content

Commit b81e5cc

Browse files
committed
review
1 parent 86f1920 commit b81e5cc

File tree

1 file changed

+19
-0
lines changed
  • docs/maintainer/example_recipes

1 file changed

+19
-0
lines changed

docs/maintainer/example_recipes/go.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,22 @@ This recipe template supports different features:
6464
If your package requires `cgo` instead of `go-nocgo`, you can use `${{ compiler("go-cgo") }}` instead to build the package. By default, the `go-nocgo` compiler [is used](https://github.com/conda-forge/staged-recipes/blob/main/.ci_support/linux64.yaml).
6565

6666
Sometimes, `go-licenses` might fail to detect licenses for some packages. In such cases, you can manually download the license file from the official source and add `--ignore github.com/bad-package/bad-package` to the `go-licenses` invokation. See [here](https://github.com/conda-forge/k9s-feedstock/blob/7929e0d86c829ba2ca172f08926f9fb7e6398247/recipe/recipe.yaml) for an example.
67+
68+
Some packages ship multiple binaries. Then, the `go build` command needs to be run for each binary.
69+
It is increasingly common for the go build command to require specifying a subdirectory, so it would look something like:
70+
71+
```bash
72+
go-licenses save ./cmd/example-package --save-path ../library_licenses
73+
go build -v -o ${PREFIX}/bin/example-package -ldflags="-s -w" ./cmd/example-package
74+
```
75+
76+
This can vary from project to project.
77+
78+
Some older Go packages that are not using Go modules yet can be converted by using:
79+
80+
```bash
81+
go mod init
82+
go mod tidy
83+
```
84+
85+
Maybe some additional work is required to make older packages buildable with Go modules.

0 commit comments

Comments
 (0)