jessevdk / go-flags

go command line option parser
http://godoc.org/github.com/jessevdk/go-flags
BSD 3-Clause "New" or "Revised" License
2.59k stars 308 forks source link

Add support for SOURCE_DATE_EPOCH for TestMan #376

Closed anthonyfok closed 4 months ago

anthonyfok commented 2 years ago

This stems from of Marina Moore’s (@mnm678) excellent work on adding SOURCE_DATE_EPOCH for reproducible builds in PR #285, and has been extended by Jelmer Vernooij (@jelmer) such that TestMan in help_test.go would not fail when SOURCE_DATE_EPOCH is set to a date different from today, e.g.:

$ SOURCE_DATE_EPOCH=1630000000 go test ./...
--- FAIL: TestMan (0.00s)
    assert_test.go:42: assert_test.go:177: Unexpected man page:

        --- got
        +++ expected
        @@ -1,4 +1,4 @@
        -.TH TestMan 1 "26 August 2021"
        +.TH TestMan 1 "2 December 2021"
         .SH NAME
         TestMan \- Test manpage generation
         .SH SYNOPSIS
FAIL
FAIL    github.com/jessevdk/go-flags    0.020s
?       github.com/jessevdk/go-flags/examples   [no test files]
FAIL

I became aware of this issue when this failed test was reported by Lucas Nussbaum (@lnussbaum) for the golang-github-itchyny-go-flags package (https://github.com/itchyny/go-flags fork) in Debian Bug#997553.

Reference: