Home / Function/ TestMappingTimeUnixNano() — gin Function Reference

TestMappingTimeUnixNano() — gin Function Reference

Architecture documentation for the TestMappingTimeUnixNano() function in form_mapping_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

binding/form_mapping_test.go lines 236–252

func TestMappingTimeUnixNano(t *testing.T) {
	type needFixUnixNanoEmpty struct {
		CreateTime time.Time `form:"createTime" time_format:"unixNano"`
	}

	// ok
	tests := []bindTestData{
		{need: &needFixUnixNanoEmpty{}, got: &needFixUnixNanoEmpty{}, in: formSource{"createTime": []string{"   "}}},
		{need: &needFixUnixNanoEmpty{}, got: &needFixUnixNanoEmpty{}, in: formSource{"createTime": []string{}}},
	}

	for _, v := range tests {
		err := mapForm(v.got, v.in)
		require.NoError(t, err)
		assert.Equal(t, v.need, v.got)
	}
}

Domain

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free