Updated Plugging in Plugins Yourself (markdown)

Matt Holt 2019-04-23 15:12:10 -06:00
parent 102c2b1ea8
commit 4c71bd2346

@ -3,7 +3,7 @@ You can build Caddy from source and plug in plugins without having to use the bu
1. [Install Go](https://golang.org/doc/install) if you don't have it already. 1. [Install Go](https://golang.org/doc/install) if you don't have it already.
2. Set the transitional environment variable for Go modules: `export GO111MODULE=on` 2. Set the transitional environment variable for Go modules: `export GO111MODULE=on`
3. Create a new folder anywhere (doesn't have to be in `$GOPATH`) - naming it `caddy` is preferred. 3. Create a new folder anywhere (doesn't have to be in `$GOPATH`) - naming it `caddy` is preferred.
4. Put this Go file into it, modifying it to import the plugins you want: 4. Put this `.go` file into it, modifying it to import the plugins you want:
```go ```go
package main package main
@ -20,5 +20,5 @@ func main() {
caddymain.Run() caddymain.Run()
} }
``` ```
5. Make your little main function a Go module: `go mod init mycaddy` (the name doesn't really matter, but the filename should end in `.go`). 5. Make your little main function a Go module: `go mod init caddy`
6. Then `go install` will then create your binary at `$GOPATH/bin`, or `go build` will put it in the current directory. 6. Then `go install` will then create your binary at `$GOPATH/bin`, or `go build` will put it in the current directory.