Skip to content

Commit 3dd4d40

Browse files
committed
Fix date
1 parent d9e1ac6 commit 3dd4d40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

analyzer_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
package goheader_test
1818

1919
import (
20+
"fmt"
2021
"go/ast"
2122
"go/parser"
2223
"go/token"
2324
"io/ioutil"
2425
"os"
2526
"path"
2627
"testing"
28+
"time"
2729

2830
goheader "github.com/denis-tingaikin/go-header"
2931
"github.com/stretchr/testify/require"
@@ -54,7 +56,7 @@ func TestAnalyzer_YearRangeValue_ShouldWorkWithComplexVariables(t *testing.T) {
5456
RawValue: "{{year-range }} B",
5557
}
5658
var a = goheader.New(goheader.WithTemplate("A {{ my-val }}"), goheader.WithValues(vals))
57-
require.Nil(t, a.Analyze(header(`A 2000-2022 B`)))
59+
require.Nil(t, a.Analyze(header(fmt.Sprintf("A 2000-%v B", time.Now().Year()))))
5860
}
5961

6062
func TestAnalyzer_Analyze1(t *testing.T) {

0 commit comments

Comments
 (0)