Sky.go client library repo and installation

61 views
Skip to first unread message

harry...@gmail.com

unread,
Jan 11, 2014, 2:22:19 AM1/11/14
to sk...@googlegroups.com
Hello,

I got skydb (unstable) installed and running. Now I am trying to install sky.go client library. I couldn't get "go get" working and so I cloned the repo manually under $GOPATH
Now the directory had a ".go" extension. "go install github.com/skydb/sky.go" now fails with "github.com/skydb/sky.go is a directory, should be a Go file".

I renamed the directory to sky_go and managed to get it working. I can now import the package as

import (
    "github.com/skydb/sky_go"
    "fmt"
)

Somehow it feels like I am fighting something I shouldn't be. What am I doing wrong?

$ go version
go version go1.2 linux/amd64
Sky is v0.4.0 (unstable , cloned today)

Note that $GOPATH/src/github.com/skydb/ already had a sky subdirectory (which does not contain any of the sky.go client files either)

Being a golong novice, I checked the golang IRC channel, and this is what they had to say

sethwklein: my guess would be some go tool is pickier than it was "10 months ago"
sethwklein: the package isn't go gettable, either
sethwklein: filing an issue might be apropriate

Thanks
--
Harry

Ben Johnson

unread,
Jan 13, 2014, 1:44:50 PM1/13/14
to harry...@gmail.com, sk...@googlegroups.com
Harry-

Building non-master branches of Go project is kind of a pain. Cloning it is the right way to go. It's fine that it has a .go extension. There's no need to "go install" it so once you clone it then you can just do:

import (
)

And it will be in the "sky" namespace. You can see an example in the Github Archive importer:


Let me know if you have anymore issues.

-- 
Ben

harry...@gmail.com

unread,
Jan 13, 2014, 6:45:55 PM1/13/14
to sk...@googlegroups.com, harry...@gmail.com
Ben,

Thanks for your reply. I will try the modified import syntax.

BTW, I did checkout/clone using git (not go get) and I was on the unstable branch.

I think the .go extension is what broke "go install". I renamed the directory to sky_go and running  "go install github.com/skydb/sky_go" worked just fine.

Thanks
--
Hari

Brandon Philips

unread,
Jan 13, 2014, 7:31:10 PM1/13/14
to sk...@googlegroups.com, harry...@gmail.com
On Mon, Jan 13, 2014 at 10:44 AM, Ben Johnson <b...@skylandlabs.com> wrote:
> import (
> "github.com/skydb/sky.go"
> )

Effective Go says that the last element should match the package name.
http://golang.org/doc/code.html#PackageNames

It might be worth moving it into github.com/skydb/sky.go/sky although
the stutter is annoying. We did the same thing on go-etcd :(

Brandon

Ben Johnson

unread,
Jan 14, 2014, 10:14:52 AM1/14/14
to Brandon Philips, sk...@googlegroups.com, harry...@gmail.com
Hari-

You shouldn't need to "go install" the client library. The install is for building a binary but there's no binary to be built for the lib. You should just need to "go get" it.

It might be worth moving it into github.com/skydb/sky.go/sky although 
the stutter is annoying. We did the same thing on go-etcd :( 
Brandon, I might change the repo name. Maybe I'll move sky over to skyd and make the sky namespace available for the library. Although it'd be nice to have a CLI for sky so maybe I'll leave it for that.

Or maybe I'll just change the library name entirely. I know it's proper form to use the same package name as the namespace name but there are quite a few libraries that break that rule.

-- 
Ben

On January 13, 2014 at 5:31:11 PM, Brandon Philips (bra...@ifup.co) wrote:

On Mon, Jan 13, 2014 at 10:44 AM, Ben Johnson <b...@skylandlabs.com> wrote:
> import (
> "github.com/skydb/sky.go"
> )

Effective Go says that the last element should match the package name.
http://golang.org/doc/code.html#PackageNames


Brandon
Reply all
Reply to author
Forward
0 new messages