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

Viper dependency #13

Closed
ignaci0 opened this issue Jan 11, 2020 · 6 comments
Closed

Viper dependency #13

ignaci0 opened this issue Jan 11, 2020 · 6 comments

Comments

@ignaci0
Copy link

ignaci0 commented Jan 11, 2020

Hi,

First of all, nice library!

I've found the following issue while trying to use it from a docker image:

        /usr/local/go/src/github.com/spf13/viper (from $GOROOT)
        /go/src/github.com/spf13/viper (from $GOPATH)

It seems the example is trying to force getting the viper module and I'm using this one because I don't want any viper ;)

Do you mind skipping the build process for the examples or removing them for good?

Thanks

@ufoscout
Copy link
Owner

Hi @ignaci0
go-up does not depend on viper.

What do you mean exactly by:

Do you mind skipping the build process for the examples or removing them for good?

If you import go-up as a dependency in your go.mod file the examples should be automatically ignored.

@ignaci0
Copy link
Author

ignaci0 commented Jan 13, 2020

Hi @ufoscout,

I use docker for builds, while building in docker (using a clean image every time), I get the following error:

        /usr/local/go/src/github.com/spf13/viper (from $GOROOT)
        /go/src/github.com/spf13/viper (from $GOPATH)
ERROR: Service 'testapp' failed to build: The command '/bin/sh -c go get -d -v ./...' returned a non-zero code: 1

By any reason, the viper example is being built even though I'm importing the library as a dependency for my testapp.

What I did for the time being is to fork the code and to delete the examples. Maybe there are better options out there to handle "examples".

@ufoscout
Copy link
Owner

@ignaci0
do you use go modules?

@ignaci0
Copy link
Author

ignaci0 commented Jan 13, 2020

Hi,

I tested it using the following:

module testapp

go 1.13

require github.com/ufoscout/go-up v0.6.0 // indirect

Same result

@ufoscout
Copy link
Owner

Ok, got it. The reasoning behind Go modules is sometimes obscure to me.

I moved the examples to a separate repository; this should fix your issue.

@ignaci0 please try version v0.6.1 and let me know.

@ignaci0
Copy link
Author

ignaci0 commented Jan 14, 2020

With version 0.6.1 is working fine!

Thanks @ufoscout

@ignaci0 ignaci0 closed this as completed Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants