no-vcs-version-override/

directory
v0.0.0-...-5d2cd60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: Apache-2.0

README

Overriding the version of oapi-codegen

Why?

oapi-codegen uses the standard Go means to determine what the version of the binary is.

However, this doesn't work when there's no Version Control System (VCS), for instance when building from a source bundle.

This example shows how to override the version at build-time.

How?

By specifying -ldflags for the noVCSVersionOverride when running go build or go run:

go run -ldflags "-X main.noVCSVersionOverride=v123.456.789" ./cmd/oapi-codegen --config=config.yaml ../../api.yaml

Directories

Path Synopsis
echo
api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL