Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #33038

Closed (moved)
(moved)
Open
Created Jan 23, 2020 by David Fifield@dcf

Represent timeouts using time.Duration

Representing these constants in time.Duration form is more semantic, and allows rewriting

if time.Since(start).Seconds() > myTimeout {

as

if time.Since(start) > myTimeout {

One side effect is that Printf formatting renders a time.Duration as a string like 10s or 100ms, which changes some log messages slightly. If we need compatibility of log message formats, we could use .Seconds() in those places.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking