Commit 9fce64c6 by Sofia Papagiannaki Committed by GitHub

Chore: Fix conversion of a 64-bit integer to a lower bit size type uint (#28425)

parent f3c09e8b
...@@ -15,10 +15,10 @@ const ( ...@@ -15,10 +15,10 @@ const (
type profilingDiagnostics struct { type profilingDiagnostics struct {
enabled bool enabled bool
port uint port uint64
} }
func newProfilingDiagnostics(enabled bool, port uint) *profilingDiagnostics { func newProfilingDiagnostics(enabled bool, port uint64) *profilingDiagnostics {
return &profilingDiagnostics{ return &profilingDiagnostics{
enabled: enabled, enabled: enabled,
port: port, port: port,
...@@ -41,7 +41,7 @@ func (pd *profilingDiagnostics) overrideWithEnv() error { ...@@ -41,7 +41,7 @@ func (pd *profilingDiagnostics) overrideWithEnv() error {
if parseErr != nil { if parseErr != nil {
return fmt.Errorf("Failed to parse %s environment variable to unsigned integer", profilingPortEnvName) return fmt.Errorf("Failed to parse %s environment variable to unsigned integer", profilingPortEnvName)
} }
pd.port = uint(port) pd.port = port
} }
return nil return nil
......
...@@ -58,7 +58,7 @@ func main() { ...@@ -58,7 +58,7 @@ func main() {
v = flag.Bool("v", false, "prints current version and exits") v = flag.Bool("v", false, "prints current version and exits")
profile = flag.Bool("profile", false, "Turn on pprof profiling") 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") tracing = flag.Bool("tracing", false, "Turn on tracing")
tracingFile = flag.String("tracing-file", "trace.out", "Define tracing output file") tracingFile = flag.String("tracing-file", "trace.out", "Define tracing output file")
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment