@@ -33,21 +33,21 @@ var _ = Describe("version package utility", func() {
3333 // this in Preflight Results.
3434 Context ("When using a VersionContext" , func () {
3535 It ("should have JSON struct tags on fields" , func () {
36- nf , nexists := reflect .TypeOf ( & Version ). Elem ().FieldByName ("Name" ) // The struct key!
36+ nf , nexists := reflect .TypeFor [ VersionContext ] ().FieldByName ("Name" ) // The struct key!
3737 Expect (nexists ).To (BeTrue ())
3838 Expect (string (nf .Tag )).To (Equal (`json:"name"` )) // the tag
3939
40- vf , vexists := reflect .TypeOf ( & Version ). Elem ().FieldByName ("Version" )
40+ vf , vexists := reflect .TypeFor [ VersionContext ] ().FieldByName ("Version" )
4141 Expect (vexists ).To (BeTrue ())
4242 Expect (string (vf .Tag )).To (Equal (`json:"version"` ))
4343
44- cf , cexists := reflect .TypeOf ( & Version ). Elem ().FieldByName ("Commit" )
44+ cf , cexists := reflect .TypeFor [ VersionContext ] ().FieldByName ("Commit" )
4545 Expect (cexists ).To (BeTrue ())
4646 Expect (string (cf .Tag )).To (Equal (`json:"commit"` ))
4747 })
4848
4949 It ("should only have three struct keys for tests to be valid" , func () {
50- keys := reflect .TypeOf ( Version ).NumField ()
50+ keys := reflect .TypeFor [ VersionContext ]( ).NumField ()
5151 Expect (keys ).To (Equal (3 ))
5252 })
5353 })
0 commit comments