https://bugzilla.redhat.com/show_bug.cgi?id=2263790
--- Comment #16 from Martin Hoyer mhoyer@redhat.com --- +1 for alternatives https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
How about using suffixes, yq-python and yq-go? Once installed, it could be something like this, hopefully with the go package doing the same. (not sure which one of the two should have higher priority)
%post update-alternatives --install %{_bindir}/yq %{name} /usr/bin/yq-python 10
%preun if [ $1 -eq 0 ]; then update-alternatives --remove %{name} %{_bindir}/yq-python fi