We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9e1ac6 commit 3dd4d40Copy full SHA for 3dd4d40
analyzer_test.go
@@ -17,13 +17,15 @@
17
package goheader_test
18
19
import (
20
+ "fmt"
21
"go/ast"
22
"go/parser"
23
"go/token"
24
"io/ioutil"
25
"os"
26
"path"
27
"testing"
28
+ "time"
29
30
goheader "github.com/denis-tingaikin/go-header"
31
"github.com/stretchr/testify/require"
@@ -54,7 +56,7 @@ func TestAnalyzer_YearRangeValue_ShouldWorkWithComplexVariables(t *testing.T) {
54
56
RawValue: "{{year-range }} B",
55
57
}
58
var a = goheader.New(goheader.WithTemplate("A {{ my-val }}"), goheader.WithValues(vals))
- 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()))))
60
61
62
func TestAnalyzer_Analyze1(t *testing.T) {
0 commit comments