From 61bb4b1be56ec509bdac47c18fedf1fe44c0c33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Sun, 11 Jun 2023 23:06:24 +0200 Subject: [PATCH] fix: fixes the package naming following the best practices from go modules. (#73) See https://go.dev/doc/modules/version-numbers\#major-version. --- README.md | 2 +- caddy/main.go | 2 +- go.mod | 7 +------ magefile.go | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b8810cb..0c22aea 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ http://127.0.0.1:8080 { Run: ```shell -xcaddy build --with github.com/corazawaf/coraza-caddy +xcaddy build --with github.com/corazawaf/coraza-caddy/v2 ``` ## Testing diff --git a/caddy/main.go b/caddy/main.go index 4d2d029..b7f0bfa 100644 --- a/caddy/main.go +++ b/caddy/main.go @@ -7,7 +7,7 @@ import ( caddycmd "github.com/caddyserver/caddy/v2/cmd" _ "github.com/caddyserver/caddy/v2/modules/standard" - _ "github.com/corazawaf/coraza-caddy" + _ "github.com/corazawaf/coraza-caddy/v2" ) func main() { diff --git a/go.mod b/go.mod index 7cc8e12..572b4d9 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/corazawaf/coraza-caddy +module github.com/corazawaf/coraza-caddy/v2 go 1.18 @@ -146,8 +146,3 @@ require ( howett.net/plist v1.0.0 // indirect rsc.io/binaryregexp v0.2.0 // indirect ) - -retract ( - [v1.0.0, v1.2.2] - v1.0.0-beta.1 -) diff --git a/magefile.go b/magefile.go index f85a391..8523645 100644 --- a/magefile.go +++ b/magefile.go @@ -41,7 +41,7 @@ func Format() error { return sh.RunV("go", "run", fmt.Sprintf("github.com/rinchsan/gosimports/cmd/gosimports@%s", gosImportsVer), "-w", "-local", - "github.com/corazawaf/coraza-caddy", + "github.com/corazawaf/coraza-caddy/v2", ".") } @@ -154,7 +154,7 @@ func buildCaddy(goos string) error { if os.Getenv("CADDY_VERSION") != "" { buildArgs = append(buildArgs, os.Getenv("CADDY_VERSION")) } - buildArgs = append(buildArgs, "--with", "github.com/corazawaf/coraza-caddy=.", + buildArgs = append(buildArgs, "--with", "github.com/corazawaf/coraza-caddy/v2=.", "--output", buildDir) return sh.RunWithV(env, "xcaddy", buildArgs...)