From 20b4ab366e7a9f4ad5e1aeab27761217438d6006 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 17 Feb 2025 13:41:19 +0100 Subject: [PATCH] cli/compose: fix "unused-receiver" linting cli/compose/schema/schema.go:25:7: unused-receiver: method receiver 'checker' is not referenced in method's body, consider removing or renaming it as _ (revive) func (checker portsFormatChecker) IsFormat(input any) bool { ^ cli/compose/schema/schema.go:41:7: unused-receiver: method receiver 'checker' is not referenced in method's body, consider removing or renaming it as _ (revive) func (checker durationFormatChecker) IsFormat(input any) bool { ^ cli/compose/loader/loader.go:272:7: unused-receiver: method receiver 'e' is not referenced in method's body, consider removing or renaming it as _ (revive) func (e *ForbiddenPropertiesError) Error() string { ^ Signed-off-by: Sebastiaan van Stijn --- cli/compose/loader/loader.go | 2 +- cli/compose/schema/schema.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/compose/loader/loader.go b/cli/compose/loader/loader.go index 564eb70a98..6cd2d2031d 100644 --- a/cli/compose/loader/loader.go +++ b/cli/compose/loader/loader.go @@ -269,7 +269,7 @@ type ForbiddenPropertiesError struct { Properties map[string]string } -func (e *ForbiddenPropertiesError) Error() string { +func (*ForbiddenPropertiesError) Error() string { return "Configuration contains forbidden properties" } diff --git a/cli/compose/schema/schema.go b/cli/compose/schema/schema.go index 9c68166e37..b636ea5bbf 100644 --- a/cli/compose/schema/schema.go +++ b/cli/compose/schema/schema.go @@ -22,7 +22,7 @@ const ( type portsFormatChecker struct{} -func (checker portsFormatChecker) IsFormat(input any) bool { +func (portsFormatChecker) IsFormat(input any) bool { var portSpec string switch p := input.(type) { @@ -38,7 +38,7 @@ func (checker portsFormatChecker) IsFormat(input any) bool { type durationFormatChecker struct{} -func (checker durationFormatChecker) IsFormat(input any) bool { +func (durationFormatChecker) IsFormat(input any) bool { value, ok := input.(string) if !ok { return false