(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestNilIfZeroTime(t *testing.T) { |
| 27 | type args struct { |
| 28 | t *time.Time |
| 29 | } |
| 30 | tests := []struct { |
| 31 | name string |
| 32 | args args |
| 33 | want *time.Time |
| 34 | }{ |
| 35 | { |
| 36 | name: "Empty date should be nil", |
| 37 | args: args{nil}, |
| 38 | want: nil, |
| 39 | }, |
| 40 | { |
| 41 | name: "Zero date should be nil", |
| 42 | args: args{&time.Time{}}, |
| 43 | want: nil, |
| 44 | }, |
| 45 | } |
| 46 | for _, tt := range tests { |
| 47 | t.Run(tt.name, func(t *testing.T) { |
| 48 | assert.Equalf(t, tt.want, NilIfZeroTime(tt.args.t), "NilIfZeroTime(%v)", tt.args.t) |
| 49 | }) |
| 50 | } |
| 51 | } |
nothing calls this directly
no test coverage detected