reflect_test.go 186 B

123456789101112131415
  1. package reflect
  2. import (
  3. "testing"
  4. "time"
  5. )
  6. func TestSet(t *testing.T) {
  7. type hack struct {
  8. Duration time.Duration
  9. }
  10. h := &hack{}
  11. Set(h, "Duration", "5s")
  12. t.Log(h.Duration)
  13. }