Fix env var name, update readme

This commit is contained in:
Matthew Holt 2020-05-23 16:32:48 -06:00
parent 5f7bbca89f
commit 23d4e0a1ca
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
2 changed files with 5 additions and 8 deletions

View file

@ -5,16 +5,13 @@ This command line tool and associated Go package makes it easy to make custom bu
It is used heavily by Caddy plugin developers as well as anyone who wishes to make custom `caddy` binaries (with or without plugins). It is used heavily by Caddy plugin developers as well as anyone who wishes to make custom `caddy` binaries (with or without plugins).
Supports Caddy 2 and up. ⚠️ Still in development. Supports Caddy 2 only.
⚠️ Still in development.
Stay updated, be aware of changes, and please submit feedback! Thanks! Stay updated, be aware of changes, and please submit feedback! Thanks!
## Requirements ## Requirements
- [Go installed](https://golang.org/doc/install) - [Go installed](https://golang.org/doc/install)
- [Go modules](https://github.com/golang/go/wiki/Modules) enabled
## Install ## Install
@ -29,8 +26,8 @@ $ go get -u github.com/caddyserver/xcaddy/cmd/xcaddy
The `xcaddy` command has two primary uses: The `xcaddy` command has two primary uses:
- Compile custom `caddy` binaries 1. Compile custom `caddy` binaries
- A replacement for `go run` while developing Caddy plugins 2. A replacement for `go run` while developing Caddy plugins
The `xcaddy` command will use the latest version of Caddy by default. You can customize this for all invocations by setting the `CADDY_VERSION` environment variable. The `xcaddy` command will use the latest version of Caddy by default. You can customize this for all invocations by setting the `CADDY_VERSION` environment variable.
@ -90,7 +87,7 @@ $ xcaddy run
$ xcaddy run --config caddy.json $ xcaddy run --config caddy.json
``` ```
The race detector can be enabled by setting `CADDY_RACE_DETECTOR=1`. The race detector can be enabled by setting `XCADDY_RACE_DETECTOR=1`.
## Library usage ## Library usage

View file

@ -30,7 +30,7 @@ import (
var ( var (
caddyVersion = os.Getenv("CADDY_VERSION") caddyVersion = os.Getenv("CADDY_VERSION")
raceDetector = os.Getenv("CADDY_RACE_DETECTOR") == "1" raceDetector = os.Getenv("XCADDY_RACE_DETECTOR") == "1"
) )
func main() { func main() {