From f074560889b046b87f81d2b3a4ef365c38c6b7b1 Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Mon, 26 Jun 2023 13:02:05 +0200 Subject: [PATCH 1/3] Add deprecation notice to http/mock module --- http/mock/mock.go | 1 + 1 file changed, 1 insertion(+) diff --git a/http/mock/mock.go b/http/mock/mock.go index 327e25c..fc498d5 100644 --- a/http/mock/mock.go +++ b/http/mock/mock.go @@ -3,4 +3,5 @@ // Features: // - RegisterQueryMapResponder form query based based on a QueryMap // - ActivateRecorder to record HTTP requests during the development of tests and examples +// Deprecated: Will be removed in a future version package checkhttpmock From bf3da3732c8fef1c570da1cb0927c8d28ead4a8e Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Mon, 26 Jun 2023 13:02:43 +0200 Subject: [PATCH 2/3] Remove deprecated Exit() function --- exit.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/exit.go b/exit.go index 604ec63..80ed064 100644 --- a/exit.go +++ b/exit.go @@ -48,13 +48,6 @@ func ExitRaw(rc int, output ...string) { BaseExit(rc) } -// Exit prints the plugin output and exits the program -// -// Deprecated, please use Exitf or ExitRaw. -func Exit(rc int, output string, args ...interface{}) { - Exitf(rc, output, args...) -} - func BaseExit(rc int) { if AllowExit { os.Exit(rc) From 6dc9a61a9a0ed1d9ecaba5c7acdb25da2a83751f Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Mon, 26 Jun 2023 13:04:53 +0200 Subject: [PATCH 3/3] Remove deprecated Add Functions --- result/overall.go | 20 -------------------- result/overall_test.go | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/result/overall.go b/result/overall.go index 357b10e..351028a 100644 --- a/result/overall.go +++ b/result/overall.go @@ -42,26 +42,6 @@ func (s *PartialResult) String() string { return fmt.Sprintf("[%s] %s", check.StatusText(s.GetStatus()), s.Output) } -// Deprecated: Will be removed in a future version, use Add() instead -func (o *Overall) AddOK(output string) { - o.Add(check.OK, output) -} - -// Deprecated: Will be removed in a future version, use Add() instead -func (o *Overall) AddWarning(output string) { - o.Add(check.Warning, output) -} - -// Deprecated: Will be removed in a future version, use Add() instead -func (o *Overall) AddCritical(output string) { - o.Add(check.Critical, output) -} - -// Deprecated: Will be removed in a future version, use Add() instead -func (o *Overall) AddUnknown(output string) { - o.Add(check.Unknown, output) -} - // Add State explicitely // Hint: This will set stateSetExplicitely to true func (o *Overall) Add(state int, output string) { diff --git a/result/overall_test.go b/result/overall_test.go index ad3a1fa..b74319e 100644 --- a/result/overall_test.go +++ b/result/overall_test.go @@ -151,7 +151,7 @@ func ExampleOverall_withSubchecks() { subcheck.SetState(check.OK) overall.AddSubcheck(subcheck) - overall.AddOK("bla") + overall.Add(0, "bla") fmt.Println(overall.GetOutput()) // Output: