github.com/ahmet2mir/goreleaser@v0.180.3-0.20210927151101-8e5ee5a9b8c5/www/docs/customization/gomod.md (about)

     1  ---
     2  title: Go Modules
     3  ---
     4  
     5  GoReleaser has support for creating verifiable builds.
     6  A [verifiable build][vgo] is one that records enough information to be precise about exactly how to repeat it.
     7  All dependencies are loaded via `proxy.golang.org`, and verified against the checksum database `sum.golang.org`.
     8  A GoReleaser-created verifiable build will include module information in the resulting binary, which can be printed using `go version -m mybinary`.
     9  
    10  Configuration options available are described below.
    11  
    12  ```yaml
    13  # goreleaser.yml
    14  
    15  gomod:
    16    # Proxy a module from proxy.golang.org, making the builds verifiable.
    17    # This will only be effective if running against a tag. Snapshots will ignore this setting.
    18    # Notice: for this to work your `build.main` must be a package, not a `.go` file.
    19    #
    20    # Default is false.
    21    proxy: true
    22  
    23    # If proxy is true, use these environment variables when running `go mod` commands (namely, `go mod tidy`).
    24    # Defaults to `os.Environ()`.
    25    env:
    26      - GOPROXY=https://proxy.golang.org,direct
    27      - GOSUMDB=sum.golang.org
    28      - GOPRIVATE=example.com/blah
    29  
    30    # Which Go binary to use.
    31    # Defaults to `go`.
    32    gobinary: go1.15
    33  ```
    34  
    35  !!! tip
    36      You can use `debug.ReadBuildInfo()` to get the version/checksum/dependencies of the module.
    37  
    38  [vgo]: https://research.swtch.com/vgo-repro