From 9fce64c6aa58f527b8cd1cc8900e284e743e9608 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki Date: Wed, 21 Oct 2020 11:25:56 +0300 Subject: [PATCH] Chore: Fix conversion of a 64-bit integer to a lower bit size type uint (#28425) --- pkg/cmd/grafana-server/diagnostics.go | 6 +++--- pkg/cmd/grafana-server/main.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/grafana-server/diagnostics.go b/pkg/cmd/grafana-server/diagnostics.go index cdb223ec47c..a2d2cf95823 100644 --- a/pkg/cmd/grafana-server/diagnostics.go +++ b/pkg/cmd/grafana-server/diagnostics.go @@ -15,10 +15,10 @@ const ( type profilingDiagnostics struct { enabled bool - port uint + port uint64 } -func newProfilingDiagnostics(enabled bool, port uint) *profilingDiagnostics { +func newProfilingDiagnostics(enabled bool, port uint64) *profilingDiagnostics { return &profilingDiagnostics{ enabled: enabled, port: port, @@ -41,7 +41,7 @@ func (pd *profilingDiagnostics) overrideWithEnv() error { if parseErr != nil { return fmt.Errorf("Failed to parse %s environment variable to unsigned integer", profilingPortEnvName) } - pd.port = uint(port) + pd.port = port } return nil diff --git a/pkg/cmd/grafana-server/main.go b/pkg/cmd/grafana-server/main.go index 556141a81d8..b68a76238e8 100644 --- a/pkg/cmd/grafana-server/main.go +++ b/pkg/cmd/grafana-server/main.go @@ -58,7 +58,7 @@ func main() { v = flag.Bool("v", false, "prints current version and exits") profile = flag.Bool("profile", false, "Turn on pprof profiling") - profilePort = flag.Uint("profile-port", 6060, "Define custom port for profiling") + profilePort = flag.Uint64("profile-port", 6060, "Define custom port for profiling") tracing = flag.Bool("tracing", false, "Turn on tracing") tracingFile = flag.String("tracing-file", "trace.out", "Define tracing output file") )