Skip to content

cmd/vet: check for time formats with 2006-02-01 #48801

Closed
@erikdubbelboer

Description

@erikdubbelboer

yyyy-dd-mm is a time format that isn't really used anywhere [1]. It is much more likely that the user intended to use
yyyy-mm-dd instead and made a mistake. This happens quite often [2] because of the unusual way to handle time formatting and parsing in Go. Since the mistake is Go specific and happens so often a vet check will be useful.

See: golang/tools#342

  1. https://stackoverflow.com/questions/2254014/are-there-locales-or-common-programs-that-use-yyyy-dd-mm-as-the-date-format
  2. https://github.com/search?l=&p=1&q=%222006-02-01%22+language%3AGo&type=Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions