From 9dfb4f5c5e5950797c08e12b2c8e3941f1654056 Mon Sep 17 00:00:00 2001 From: Yad Smood <1415488+ysmood@users.noreply.github.com> Date: Tue, 20 Aug 2024 01:43:42 +0800 Subject: [PATCH] ensure v2 go mod follows the convention --- api_tests/main.go | 6 +++--- cloudflare/api.go | 8 ++++---- cmd/generate/generate.go | 10 +++++----- cmd/register/register.go | 10 +++++----- cmd/root.go | 18 +++++++++--------- cmd/shared/shared.go | 6 +++--- cmd/status/status.go | 6 +++--- cmd/trace/trace.go | 4 ++-- cmd/update/update.go | 8 ++++---- go.mod | 7 ++----- main.go | 4 ++-- openapi/go.mod | 11 ----------- openapi/go.sum | 39 --------------------------------------- 13 files changed, 42 insertions(+), 95 deletions(-) delete mode 100644 openapi/go.mod delete mode 100644 openapi/go.sum diff --git a/api_tests/main.go b/api_tests/main.go index d94dd775..95817d9f 100644 --- a/api_tests/main.go +++ b/api_tests/main.go @@ -10,9 +10,9 @@ import ( opticgo "github.com/ViRb3/optic-go" "github.com/ViRb3/sling/v2" - "github.com/ViRb3/wgcf/cloudflare" - "github.com/ViRb3/wgcf/util" - "github.com/ViRb3/wgcf/wireguard" + "github.com/ViRb3/wgcf/v2/cloudflare" + "github.com/ViRb3/wgcf/v2/util" + "github.com/ViRb3/wgcf/v2/wireguard" ) var defaultHeaders = map[string]string{} diff --git a/cloudflare/api.go b/cloudflare/api.go index 6a042bc9..78fdd474 100644 --- a/cloudflare/api.go +++ b/cloudflare/api.go @@ -5,10 +5,10 @@ import ( "net/http" "time" - "github.com/ViRb3/wgcf/config" - "github.com/ViRb3/wgcf/openapi" - "github.com/ViRb3/wgcf/util" - "github.com/ViRb3/wgcf/wireguard" + "github.com/ViRb3/wgcf/v2/config" + "github.com/ViRb3/wgcf/v2/openapi" + "github.com/ViRb3/wgcf/v2/util" + "github.com/ViRb3/wgcf/v2/wireguard" ) const ( diff --git a/cmd/generate/generate.go b/cmd/generate/generate.go index cd20672e..cb815d40 100644 --- a/cmd/generate/generate.go +++ b/cmd/generate/generate.go @@ -3,11 +3,11 @@ package generate import ( "log" - "github.com/ViRb3/wgcf/cloudflare" - . "github.com/ViRb3/wgcf/cmd/shared" - "github.com/ViRb3/wgcf/config" - "github.com/ViRb3/wgcf/util" - "github.com/ViRb3/wgcf/wireguard" + "github.com/ViRb3/wgcf/v2/cloudflare" + . "github.com/ViRb3/wgcf/v2/cmd/shared" + "github.com/ViRb3/wgcf/v2/config" + "github.com/ViRb3/wgcf/v2/util" + "github.com/ViRb3/wgcf/v2/wireguard" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/cmd/register/register.go b/cmd/register/register.go index daca0db5..643ef09b 100644 --- a/cmd/register/register.go +++ b/cmd/register/register.go @@ -4,11 +4,11 @@ import ( "fmt" "log" - "github.com/ViRb3/wgcf/cloudflare" - . "github.com/ViRb3/wgcf/cmd/shared" - "github.com/ViRb3/wgcf/config" - "github.com/ViRb3/wgcf/util" - "github.com/ViRb3/wgcf/wireguard" + "github.com/ViRb3/wgcf/v2/cloudflare" + . "github.com/ViRb3/wgcf/v2/cmd/shared" + "github.com/ViRb3/wgcf/v2/config" + "github.com/ViRb3/wgcf/v2/util" + "github.com/ViRb3/wgcf/v2/wireguard" "github.com/manifoldco/promptui" "github.com/pkg/errors" "github.com/spf13/cobra" diff --git a/cmd/root.go b/cmd/root.go index 68e29d9c..711d2b00 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,14 +4,14 @@ import ( "errors" "log" - "github.com/ViRb3/wgcf/cmd/generate" - "github.com/ViRb3/wgcf/cmd/register" - . "github.com/ViRb3/wgcf/cmd/shared" - "github.com/ViRb3/wgcf/cmd/status" - "github.com/ViRb3/wgcf/cmd/trace" - "github.com/ViRb3/wgcf/cmd/update" - "github.com/ViRb3/wgcf/config" - "github.com/ViRb3/wgcf/util" + "github.com/ViRb3/wgcf/v2/cmd/generate" + "github.com/ViRb3/wgcf/v2/cmd/register" + . "github.com/ViRb3/wgcf/v2/cmd/shared" + "github.com/ViRb3/wgcf/v2/cmd/status" + "github.com/ViRb3/wgcf/v2/cmd/trace" + "github.com/ViRb3/wgcf/v2/cmd/update" + "github.com/ViRb3/wgcf/v2/config" + "github.com/ViRb3/wgcf/v2/util" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -25,7 +25,7 @@ var RootCmd = &cobra.Command{ Long: FormatMessage("", ` wgcf is a utility for Cloudflare Warp that allows you to create and manage accounts, assign license keys, and generate WireGuard profiles. -Made by Victor (@ViRb3). Project website: https://github.com/ViRb3/wgcf`), +Made by Victor (@ViRb3). Project website: https://github.com/ViRb3/wgcf/v2`), Run: func(cmd *cobra.Command, args []string) { if err := cmd.Help(); err != nil { log.Fatal(util.GetErrorMessage(err)) diff --git a/cmd/shared/shared.go b/cmd/shared/shared.go index 23f9c7bb..d61c2dd5 100644 --- a/cmd/shared/shared.go +++ b/cmd/shared/shared.go @@ -6,9 +6,9 @@ import ( "math" "strings" - "github.com/ViRb3/wgcf/cloudflare" - "github.com/ViRb3/wgcf/config" - "github.com/ViRb3/wgcf/util" + "github.com/ViRb3/wgcf/v2/cloudflare" + "github.com/ViRb3/wgcf/v2/config" + "github.com/ViRb3/wgcf/v2/util" "github.com/pkg/errors" "github.com/spf13/viper" diff --git a/cmd/status/status.go b/cmd/status/status.go index 40b98446..df983649 100644 --- a/cmd/status/status.go +++ b/cmd/status/status.go @@ -3,9 +3,9 @@ package status import ( "log" - "github.com/ViRb3/wgcf/cloudflare" - . "github.com/ViRb3/wgcf/cmd/shared" - "github.com/ViRb3/wgcf/util" + "github.com/ViRb3/wgcf/v2/cloudflare" + . "github.com/ViRb3/wgcf/v2/cmd/shared" + "github.com/ViRb3/wgcf/v2/util" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/cmd/trace/trace.go b/cmd/trace/trace.go index 450406ff..61a3e7f7 100644 --- a/cmd/trace/trace.go +++ b/cmd/trace/trace.go @@ -7,8 +7,8 @@ import ( "net/http" "strings" - . "github.com/ViRb3/wgcf/cmd/shared" - "github.com/ViRb3/wgcf/util" + . "github.com/ViRb3/wgcf/v2/cmd/shared" + "github.com/ViRb3/wgcf/v2/util" "github.com/spf13/cobra" ) diff --git a/cmd/update/update.go b/cmd/update/update.go index 4157e986..ff5d75eb 100644 --- a/cmd/update/update.go +++ b/cmd/update/update.go @@ -3,10 +3,10 @@ package update import ( "log" - "github.com/ViRb3/wgcf/cloudflare" - . "github.com/ViRb3/wgcf/cmd/shared" - "github.com/ViRb3/wgcf/config" - "github.com/ViRb3/wgcf/util" + "github.com/ViRb3/wgcf/v2/cloudflare" + . "github.com/ViRb3/wgcf/v2/cmd/shared" + "github.com/ViRb3/wgcf/v2/config" + "github.com/ViRb3/wgcf/v2/util" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index b1d6e004..95e31660 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,16 @@ -module github.com/ViRb3/wgcf +module github.com/ViRb3/wgcf/v2 go 1.18 -replace github.com/ViRb3/wgcf/openapi => ./openapi - require ( github.com/ViRb3/optic-go v0.0.0-20240309111653-486347a8369d github.com/ViRb3/sling/v2 v2.0.2 - github.com/ViRb3/wgcf/openapi v0.0.0-20240309103509-71e9ce8d36bc github.com/manifoldco/promptui v0.9.0 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 golang.org/x/crypto v0.21.0 + golang.org/x/oauth2 v0.18.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -43,7 +41,6 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/main.go b/main.go index aa290450..87dd766f 100644 --- a/main.go +++ b/main.go @@ -3,8 +3,8 @@ package main import ( "log" - "github.com/ViRb3/wgcf/cmd" - "github.com/ViRb3/wgcf/util" + "github.com/ViRb3/wgcf/v2/cmd" + "github.com/ViRb3/wgcf/v2/util" ) func main() { diff --git a/openapi/go.mod b/openapi/go.mod deleted file mode 100644 index 71ccdc6d..00000000 --- a/openapi/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/GIT_USER_ID/GIT_REPO_ID - -go 1.18 - -require golang.org/x/oauth2 v0.18.0 - -require ( - github.com/golang/protobuf v1.5.4 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/protobuf v1.33.0 // indirect -) diff --git a/openapi/go.sum b/openapi/go.sum deleted file mode 100644 index 2577cdbf..00000000 --- a/openapi/go.sum +++ /dev/null @@ -1,39 +0,0 @@ -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= -golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=