of reflection, now comes the real question. Should you be using reflection? I would like to quote Rob Pike's proverb on the use of reflection which answers this question.
Clear is better than clever. Reflection is never clear.
Reflection is a very powerful and advanced concept in Go and it should be used with care. It is very difficult to write clear and maintainable code using reflection. It should be avoided wherever possible and should be used only when absolutely necessary.
Вот ровно то, что обсуждали сегодня раньше.
Ну да, с этим сложно не согласиться, явно не стоит пихать reflect куда попало =)
Обсуждают сегодня