From f8ff75d3edfe4fcbdaf4168f39e7215af883f861 Mon Sep 17 00:00:00 2001 From: Reinhard Naegele Date: Fri, 27 Sep 2019 08:44:23 +0200 Subject: [PATCH 1/2] Fix module Starting at v2, the module path must end in the major version. The fakes were updated manually, which is not ideal. They seem to have been edited manually before. I had tried to regenerate them but the tests wouldn't run. --- README.md | 6 +++--- checkers/reachable_test.go | 6 +++--- checkers/sql_test.go | 2 +- examples/custom-checker-server/custom-checker-server.go | 4 ++-- examples/simple-http-server/simple-http-server.go | 6 +++--- examples/status-listener/service/service.go | 6 +++--- fakes/ireachabledatadogincrementer.go | 2 +- fakes/isqlexecer.go | 2 +- fakes/isqlpinger.go | 2 +- fakes/isqlqueryer.go | 2 +- go.mod | 2 +- handlers/README.md | 8 ++++---- handlers/handlers.go | 2 +- health.go | 2 +- health_shared_test.go | 2 +- health_test.go | 2 +- 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 2b05dd6..7fab273 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ For _full_ examples, look through the [examples dir](examples/) ```golang import ( - health "github.com/InVisionApp/go-health" - "github.com/InVisionApp/go-health/checkers" - "github.com/InVisionApp/go-health/handlers" + health "github.com/InVisionApp/go-health/v2" + "github.com/InVisionApp/go-health/v2/checkers" + "github.com/InVisionApp/go-health/v2/handlers" ) // Create a new health instance diff --git a/checkers/reachable_test.go b/checkers/reachable_test.go index 4433619..6de64c3 100644 --- a/checkers/reachable_test.go +++ b/checkers/reachable_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/InVisionApp/go-health/checkers" - "github.com/InVisionApp/go-health/fakes" - "github.com/InVisionApp/go-health/fakes/netfakes" + "github.com/InVisionApp/go-health/v2/checkers" + "github.com/InVisionApp/go-health/v2/fakes" + "github.com/InVisionApp/go-health/v2/fakes/netfakes" "github.com/stretchr/testify/assert" ) diff --git a/checkers/sql_test.go b/checkers/sql_test.go index b7cbf22..22de776 100644 --- a/checkers/sql_test.go +++ b/checkers/sql_test.go @@ -7,8 +7,8 @@ import ( "fmt" "testing" - . "github.com/onsi/gomega" "github.com/DATA-DOG/go-sqlmock" + . "github.com/onsi/gomega" ) const execSQL = "UPDATE some_table" diff --git a/examples/custom-checker-server/custom-checker-server.go b/examples/custom-checker-server/custom-checker-server.go index 3dea93b..93641dc 100644 --- a/examples/custom-checker-server/custom-checker-server.go +++ b/examples/custom-checker-server/custom-checker-server.go @@ -6,8 +6,8 @@ import ( "net/http" "time" - "github.com/InVisionApp/go-health" - "github.com/InVisionApp/go-health/handlers" + "github.com/InVisionApp/go-health/v2" + "github.com/InVisionApp/go-health/v2/handlers" ) type customCheck struct{} diff --git a/examples/simple-http-server/simple-http-server.go b/examples/simple-http-server/simple-http-server.go index 3abfa16..f6d3e67 100644 --- a/examples/simple-http-server/simple-http-server.go +++ b/examples/simple-http-server/simple-http-server.go @@ -6,9 +6,9 @@ import ( "net/url" "time" - "github.com/InVisionApp/go-health" - "github.com/InVisionApp/go-health/checkers" - "github.com/InVisionApp/go-health/handlers" + "github.com/InVisionApp/go-health/v2" + "github.com/InVisionApp/go-health/v2/checkers" + "github.com/InVisionApp/go-health/v2/handlers" ) func main() { diff --git a/examples/status-listener/service/service.go b/examples/status-listener/service/service.go index 38824fe..ac4e812 100644 --- a/examples/status-listener/service/service.go +++ b/examples/status-listener/service/service.go @@ -7,9 +7,9 @@ import ( "os" "time" - "github.com/InVisionApp/go-health" - "github.com/InVisionApp/go-health/checkers" - "github.com/InVisionApp/go-health/handlers" + "github.com/InVisionApp/go-health/v2" + "github.com/InVisionApp/go-health/v2/checkers" + "github.com/InVisionApp/go-health/v2/handlers" ) var svcLogger *log.Logger diff --git a/fakes/ireachabledatadogincrementer.go b/fakes/ireachabledatadogincrementer.go index 03beabd..4e27066 100644 --- a/fakes/ireachabledatadogincrementer.go +++ b/fakes/ireachabledatadogincrementer.go @@ -4,7 +4,7 @@ package fakes import ( "sync" - "github.com/InVisionApp/go-health/checkers" + "github.com/InVisionApp/go-health/v2/checkers" ) type FakeReachableDatadogIncrementer struct { diff --git a/fakes/isqlexecer.go b/fakes/isqlexecer.go index f912fe8..1a1cecf 100644 --- a/fakes/isqlexecer.go +++ b/fakes/isqlexecer.go @@ -6,7 +6,7 @@ import ( "database/sql" "sync" - "github.com/InVisionApp/go-health/checkers" + "github.com/InVisionApp/go-health/v2/checkers" ) type FakeSQLExecer struct { diff --git a/fakes/isqlpinger.go b/fakes/isqlpinger.go index b4858b4..e4aab8a 100644 --- a/fakes/isqlpinger.go +++ b/fakes/isqlpinger.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/InVisionApp/go-health/checkers" + "github.com/InVisionApp/go-health/v2/checkers" ) type FakeSQLPinger struct { diff --git a/fakes/isqlqueryer.go b/fakes/isqlqueryer.go index 34980be..9106dde 100644 --- a/fakes/isqlqueryer.go +++ b/fakes/isqlqueryer.go @@ -6,7 +6,7 @@ import ( "database/sql" "sync" - "github.com/InVisionApp/go-health/checkers" + "github.com/InVisionApp/go-health/v2/checkers" ) type FakeSQLQueryer struct { diff --git a/go.mod b/go.mod index 04e8cdc..948a89d 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/InVisionApp/go-health +module github.com/InVisionApp/go-health/v2 require ( github.com/DATA-DOG/go-sqlmock v1.3.3 diff --git a/handlers/README.md b/handlers/README.md index 0234c54..12a6057 100644 --- a/handlers/README.md +++ b/handlers/README.md @@ -9,9 +9,9 @@ it at a handler func. ```golang import ( - "github.com/InVisionApp/go-health" - "github.com/InVisionApp/go-health/checkers" - "github.com/InVisionApp/go-health/handlers" + "github.com/InVisionApp/go-health/v2" + "github.com/InVisionApp/go-health/v2/checkers" + "github.com/InVisionApp/go-health/v2/handlers" ) // create and configure a new health instance @@ -50,4 +50,4 @@ If any check fails that is configured as `fatal` - the handler will return a ## `handlers.NewBasicHandlerFunc` example output ``` ok || failed -``` \ No newline at end of file +``` diff --git a/handlers/handlers.go b/handlers/handlers.go index d0f442f..2d8e017 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -6,7 +6,7 @@ import ( "net/http" "sync" - "github.com/InVisionApp/go-health" + "github.com/InVisionApp/go-health/v2" ) type jsonStatus struct { diff --git a/health.go b/health.go index f542236..087a326 100644 --- a/health.go +++ b/health.go @@ -2,7 +2,7 @@ // // For additional overview, documentation and contribution guidelines, refer to the project's "README.md". // -// For example usage, refer to https://github.com/InVisionApp/go-health/tree/master/examples/simple-http-server. +// For example usage, refer to https://module github.com/InVisionApp/go-health/v2/tree/master/examples/simple-http-server. package health import ( diff --git a/health_shared_test.go b/health_shared_test.go index 7ed5d35..38bc8c1 100644 --- a/health_shared_test.go +++ b/health_shared_test.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/InVisionApp/go-health/fakes" + "github.com/InVisionApp/go-health/v2/fakes" "github.com/InVisionApp/go-logger" ) diff --git a/health_test.go b/health_test.go index 1decbbd..4d7d986 100644 --- a/health_test.go +++ b/health_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/gomega" - "github.com/InVisionApp/go-health/fakes" + "github.com/InVisionApp/go-health/v2/fakes" "github.com/InVisionApp/go-logger" "github.com/InVisionApp/go-logger/shims/testlog" ) From 662cca16e90e37feedd3fa495ce8769a19d6cc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Fri, 27 Sep 2019 21:52:39 +0200 Subject: [PATCH 2/2] Fix comment --- health.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health.go b/health.go index 087a326..f542236 100644 --- a/health.go +++ b/health.go @@ -2,7 +2,7 @@ // // For additional overview, documentation and contribution guidelines, refer to the project's "README.md". // -// For example usage, refer to https://module github.com/InVisionApp/go-health/v2/tree/master/examples/simple-http-server. +// For example usage, refer to https://github.com/InVisionApp/go-health/tree/master/examples/simple-http-server. package health import (