Repository: goadesign/goa
Pull request #3555 (2024-07-08 21:56:31)

Address linter issue


Patch:
diff --git a/codegen/example/templates/server_handler.go.tpl b/codegen/example/templates/server_handler.go.tpl
index 82a84121..6b2eaf40 100644
--- a/codegen/example/templates/server_handler.go.tpl
+++ b/codegen/example/templates/server_handler.go.tpl
@@ -50,5 +50,5 @@
 	{{ end }}
 {{- end }}
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: {{ join .Server.AvailableHosts "|" }})\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: {{ join .Server.AvailableHosts "|" }})", *hostF))
 	}	
\ No newline at end of file


Test patch:
diff --git a/codegen/example/testdata/server-no-server.golden b/codegen/example/testdata/server-no-server.golden
index 097881aa..8d6ed8fb 100644
--- a/codegen/example/testdata/server-no-server.golden
+++ b/codegen/example/testdata/server-no-server.golden
@@ -109,7 +109,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-same-api-service-name.golden b/codegen/example/testdata/server-same-api-service-name.golden
index c9039e15..30462fad 100644
--- a/codegen/example/testdata/server-same-api-service-name.golden
+++ b/codegen/example/testdata/server-same-api-service-name.golden
@@ -109,7 +109,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-sercice-for-only-grpc.golden b/codegen/example/testdata/server-sercice-for-only-grpc.golden
index 0bdea129..37d920f6 100644
--- a/codegen/example/testdata/server-sercice-for-only-grpc.golden
+++ b/codegen/example/testdata/server-sercice-for-only-grpc.golden
@@ -85,7 +85,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-server-hosting-multiple-services.golden b/codegen/example/testdata/server-server-hosting-multiple-services.golden
index fb2c9f99..50ff33ea 100644
--- a/codegen/example/testdata/server-server-hosting-multiple-services.golden
+++ b/codegen/example/testdata/server-server-hosting-multiple-services.golden
@@ -115,7 +115,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-server-hosting-service-subset.golden b/codegen/example/testdata/server-server-hosting-service-subset.golden
index 03b9901a..ee3a68a0 100644
--- a/codegen/example/testdata/server-server-hosting-service-subset.golden
+++ b/codegen/example/testdata/server-server-hosting-service-subset.golden
@@ -109,7 +109,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-server-hosting-service-with-file-server.golden b/codegen/example/testdata/server-server-hosting-service-with-file-server.golden
index 35ce69cd..7c53ba36 100644
--- a/codegen/example/testdata/server-server-hosting-service-with-file-server.golden
+++ b/codegen/example/testdata/server-server-hosting-service-with-file-server.golden
@@ -65,7 +65,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: svc)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: svc)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-service-for-http-and-part-of-grpc.golden b/codegen/example/testdata/server-service-for-http-and-part-of-grpc.golden
index 6ec133cc..9d052dac 100644
--- a/codegen/example/testdata/server-service-for-http-and-part-of-grpc.golden
+++ b/codegen/example/testdata/server-service-for-http-and-part-of-grpc.golden
@@ -115,7 +115,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-service-for-only-http.golden b/codegen/example/testdata/server-service-for-only-http.golden
index 58167327..b50a52e1 100644
--- a/codegen/example/testdata/server-service-for-only-http.golden
+++ b/codegen/example/testdata/server-service-for-only-http.golden
@@ -84,7 +84,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: localhost)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-service-name-with-spaces.golden b/codegen/example/testdata/server-service-name-with-spaces.golden
index b7a92773..cd3eeee2 100644
--- a/codegen/example/testdata/server-service-name-with-spaces.golden
+++ b/codegen/example/testdata/server-service-name-with-spaces.golden
@@ -109,7 +109,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: svc)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: svc)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-single-server-multiple-hosts-with-variables.golden b/codegen/example/testdata/server-single-server-multiple-hosts-with-variables.golden
index 74f9b9d7..0be79fe5 100644
--- a/codegen/example/testdata/server-single-server-multiple-hosts-with-variables.golden
+++ b/codegen/example/testdata/server-single-server-multiple-hosts-with-variables.golden
@@ -127,7 +127,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev|stage)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev|stage)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-single-server-multiple-hosts.golden b/codegen/example/testdata/server-single-server-multiple-hosts.golden
index 5762fccd..1752cb39 100644
--- a/codegen/example/testdata/server-single-server-multiple-hosts.golden
+++ b/codegen/example/testdata/server-single-server-multiple-hosts.golden
@@ -109,7 +109,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev|stage)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev|stage)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-single-server-single-host-with-variables.golden b/codegen/example/testdata/server-single-server-single-host-with-variables.golden
index 27e74815..f0b480af 100644
--- a/codegen/example/testdata/server-single-server-single-host-with-variables.golden
+++ b/codegen/example/testdata/server-single-server-single-host-with-variables.golden
@@ -135,7 +135,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)", *hostF))
 	}
 
 	// Wait for signal.
diff --git a/codegen/example/testdata/server-single-server-single-host.golden b/codegen/example/testdata/server-single-server-single-host.golden
index 7ff78725..57c0d3f2 100644
--- a/codegen/example/testdata/server-single-server-single-host.golden
+++ b/codegen/example/testdata/server-single-server-single-host.golden
@@ -157,7 +157,7 @@ func main() {
 		}
 
 	default:
-		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)\n", *hostF))
+		log.Fatal(ctx, fmt.Errorf("invalid host argument: %q (valid hosts: dev)", *hostF))
 	}
 
 	// Wait for signal.