metac icon indicating copy to clipboard operation
metac copied to clipboard

ability to use 'go get' to pull metac

Open AmitKumarDas opened this issue 5 years ago • 1 comments

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/[email protected]: 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 avatar Dec 13 '19 07:12 AmitKumarDas

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

AmitKumarDas avatar Dec 13 '19 10:12 AmitKumarDas