Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update viper to v1.4.0 #953

Merged
merged 1 commit into from
Oct 14, 2019
Merged

update viper to v1.4.0 #953

merged 1 commit into from
Oct 14, 2019

Conversation

umarcor
Copy link
Contributor

@umarcor umarcor commented Sep 8, 2019

Fix #938
Fix #978

@umarcor
Copy link
Contributor Author

umarcor commented Sep 9, 2019

@kowloonzh, @plo-, do you mind testing/reviewing this?

@plo-
Copy link

plo- commented Sep 10, 2019

Seems ok for me, thanks!

@umarcor umarcor mentioned this pull request Oct 2, 2019
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
@kowloonzh
Copy link

Seems ok for me, thanks!

hi, plo

could you please tell my how to testing it.

i failed by use go get github.com/spf13/cobra@a4bc1a0fefe97a46dddf831c9648b18336be751e, either failed by use go get github.com/umarcor/cobra@update-viper.

anyway, i think it will works for me when the viper version is up to 1.4

@umarcor
Copy link
Contributor Author

umarcor commented Oct 6, 2019

@kowloonzh you might try temporaly adding replace github.com/spf13/cobra => github.com/umarcor/cobra update-viper to the go.mod file of your project.

@kowloonzh
Copy link

@kowloonzh you might try temporaly adding replace github.com/spf13/cobra => github.com/umarcor/cobra update-viper to the go.mod file of your project.

thank you very much for help,

i had add replace github.com/spf13/cobra => github.com/umarcor/cobra v0.0.6-0.20190917162959-a4bc1a0fefe9 to the go.mod file, but it not works to me, anything else i missed? my repo link is https://github.com/hulklab/yago

@umarcor
Copy link
Contributor Author

umarcor commented Oct 6, 2019

docker run --rm -it golang bash -c "
git clone https://github.com/hulklab/yago
cd yago
go build
"

works here. what are you trying to fix?

@jharshman jharshman added this to the 1.0.0 milestone Oct 7, 2019
@jharshman jharshman added the kind/feature A feature request for cobra; new or enhanced behavior label Oct 14, 2019
@jharshman jharshman self-assigned this Oct 14, 2019
@jharshman jharshman merged commit 8a4b46f into spf13:master Oct 14, 2019
@kowloonzh
Copy link

kowloonzh commented Oct 14, 2019

@umarcor
hi, umarcor
thank you at first.

it works fine cause i add the replace statement replace github.com/ugorji/go v1.1.4 => github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43 at the end of go.mod in master branch

i pushed the my branch viper_update and please run the following command, then you can see the problem:

docker run --rm -it golang bash -c "
git clone https://github.com/hulklab/yago
cd yago
git checkout viper_update
go build
"

the error output just like this:

ambiguous import: found github.com/ugorji/go/codec in multiple modules:
	github.com/ugorji/go v1.1.4 (/go/pkg/mod/github.com/ugorji/[email protected]/codec)
	github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f (/go/pkg/mod/github.com/ugorji/go/[email protected])

@umarcor umarcor deleted the update-viper branch October 14, 2019 11:19
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 14, 2019
@umarcor
Copy link
Contributor Author

umarcor commented Oct 14, 2019

@kowloonzh, I think that you do need the replace statement indepently of viper being updated to v1.4.0. This is because ugorji/go needs to be updated to v1.1.7: https://github.com/ugorji/go/releases/tag/v1.1.7. Apart from viper v1.4.0, there is another dependency in your go.mod (https://github.com/hulklab/yago/blob/master/go.mod#L14) that is using v1.1.4 of ugorji/go: https://github.com/gin-gonic/gin/blob/v1.4.0/go.mod#L13. Hence, new fixed releases of gin-gonic/gin, spf13/viper and spf13/cobra need to be published before you can remove the replace statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A feature request for cobra; new or enhanced behavior
Projects
None yet
4 participants