From e48c1172f346dd447d3b5865173f6fdd03c629ec Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:20:11 +0000 Subject: [PATCH] refactor: multiple `append` combined into a single call Multiple calls for `append` could be combined into a single call for `append`. --- main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index c08bc86..adb5320 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import "fmt" const ( - productPath string = "/tmp/products.json" + productPath string = "/tmp/products.json" sellerPath string = "/tmp/sellers.json" ) @@ -17,9 +17,9 @@ func main() { var i GenericInterface i = &s - givenCity := "Gotham" + givenCity := "Gotham" - switch i.(type) { + switch i.(type) { case interface{}: fmt.Println("What to do") case Product: @@ -31,6 +31,5 @@ func main() { func appendData() { var s []string - s = append(s, productPath) - s = append(s, sellerPath) + s = append(s, productPath, sellerPath) }