package reflect import ( "testing" "time" ) func TestSet(t *testing.T) { type hack struct { Duration time.Duration } h := &hack{} Set(h, "Duration", "5s") t.Log(h.Duration) }