AmitKumarDas / metac

It is metacontroller and more
Apache License 2.0
57 stars 16 forks source link

ability to use 'go get' to pull metac #74

Open AmitKumarDas opened 4 years ago

AmitKumarDas commented 4 years ago

These were some comments/suggestions received from community in metacontroller slack channel.

I'm trying to use metac as a library (following this example): https://github.com/AmitKumarDas/metac/blob/master/examples/gctl/set-status-on-cr/main.go

go get -u github.com/AmitKumarDas/metac
go get: github.com/AmitKumarDas/metac@v0.1.0: parsing go.mod:
    module declares its path as: openebs.io/metac
            but was required as: github.com/AmitKumarDas/metac
exit status 1
go get -u openebs.io/metac
go get openebs.io/metac: unrecognized import path "openebs.io/metac" (parse https://openebs.io/metac?go-get=1: no go-import meta tags ())
exit status 1
...
Thanks.  I'm using go modules with go 1.13, but not vendoring.
I got it working by adding those particular require and replace 
directives from the sample go.mod in my own program.  
It just seemed awkward.

If you want to keep the code hosted on github, but want to 
continue using the module name at openebs.io consider setting 
up the "vanity domain" stuff for that domain, so that go get works: 
https://sagikazarmark.hu/blog/vanity-import-paths-in-go/ (edited) 

I *really* like how `metac` can be imported as a library.  Super nice 
feature.  As a go developer, it would be great to be able to go get 
that, the same as I can for k8s.io modules, etc.
AmitKumarDas commented 4 years ago

I guess this can be tied with https://github.com/AmitKumarDas/metac/issues/65 to solve both