Skip to content

Commit

Permalink
fix: Unified variable management
Browse files Browse the repository at this point in the history
Signed-off-by: fsl <1171313930@qq.com>
  • Loading branch information
fengshunli committed Jul 21, 2024
1 parent 66d6b4f commit ceefa5b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,14 @@ func init() {
}
func main() {
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
var secureMetrics bool
var enableHTTP2 bool
var (
enableLeaderElection bool
secureMetrics bool
enableHTTP2 bool
metricsAddr string
probeAddr string
tlsOpts []func(*tls.Config)
)
flag.StringVar(&metricsAddr, "metrics-bind-address", "0", "The address the metrics endpoint binds to. " +
"Use :8443 for HTTPS or :8080 for HTTP, or leave as 0 to disable the metrics service.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
Expand Down Expand Up @@ -255,7 +258,6 @@ func main() {
c.NextProtos = []string{"http/1.1"}
}
tlsOpts := []func(*tls.Config){}
if !enableHTTP2 {
tlsOpts = append(tlsOpts, disableHTTP2)
}
Expand Down

0 comments on commit ceefa5b

Please sign in to comment.