package intimate import ( "log" "reflect" "testing" ) type Store struct { } func NewStore() *Store { return &Store{} } func (store *Store) Update(obj interface{}, objfields ...interface{}) { ov := reflect.ValueOf(obj) ot := ov.Type() log.Printf("%#v,%#v", ov, ot) log.Println(reflect.Indirect(reflect.ValueOf(objfields[0]))) } func TestAutoStore(t *testing.T) { store := NewStore() streamer := &Streamer{} store.Update(streamer, streamer.Channel) }