[ANN] Go-Camo - a Go version of Github's Camo server

230 views
Skip to first unread message

elij

unread,
Jul 28, 2012, 1:45:05 PM7/28/12
to golan...@googlegroups.com
Go-Camo[1] is a Go version of Github's Camo server[2][3].

Currently not in production use, but hopefully will eventually replace an existing python reimplementation of Github Camo.

I welcome any feedback.

[1]: http://cactus.github.com/go-camo/
[2]: https://github.com/atmos/camo
[3]: https://github.com/blog/743-sidejack-prevention-phase-3-ssl-proxied-assets


Archos

unread,
Jul 29, 2012, 3:11:22 AM7/29/12
to golan...@googlegroups.com
Please, don't use Ruby in tests. Go has a library to deal with tests

http://golang.org/pkg/testing/

Andrew Gerrand

unread,
Jul 29, 2012, 7:12:49 PM7/29/12
to elij, golan...@googlegroups.com
Neat project.

The way you have laid out the package is unidiomatic, though. You
shouldn't require users of your program to change their GOPATH.

Instead of the paths

github.com/cactus/go-camo/src/go-camo
github.com/cactus/go-camo/src/go-camo/camoproxy

and the import

import "go-camo/camoproxy"

you should drop the "src/go-camo" components, giving the paths

github.com/cactus/go-camo
github.com/cactus/go-camo/camoproxy

and the import

import "github.com/cactus/go-camo/camoproxy"

With these changes, I can install go-camo with one command:

go get github.com/cactus/go-camo

Andrew

elij

unread,
Jul 29, 2012, 10:42:09 PM7/29/12
to Archos, golan...@googlegroups.com
The tests are from Github's camo project, and are used to reflect conformance.

elij

unread,
Jul 29, 2012, 10:46:41 PM7/29/12
to Andrew Gerrand, golan...@googlegroups.com
On Sunday, July 29, 2012 at 4:12 PM, Andrew Gerrand wrote:
> Neat project.

thanks!

> The way you have laid out the package is unidiomatic, though. You
> shouldn't require users of your program to change their GOPATH.
>
> Instead of the paths
>
> github.com/cactus/go-camo/src/go-camo (http://github.com/cactus/go-camo/src/go-camo)
> github.com/cactus/go-camo/src/go-camo/camoproxy (http://github.com/cactus/go-camo/src/go-camo/camoproxy)
>
> and the import
>
> import "go-camo/camoproxy"
>
> you should drop the "src/go-camo" components, giving the paths
>
> github.com/cactus/go-camo (http://github.com/cactus/go-camo)
> github.com/cactus/go-camo/camoproxy (http://github.com/cactus/go-camo/camoproxy)
>
> and the import
>
> import "github.com/cactus/go-camo/camoproxy (http://github.com/cactus/go-camo/camoproxy)"
>
> With these changes, I can install go-camo with one command:
>
> go get github.com/cactus/go-camo (http://github.com/cactus/go-camo)
I had asked a while back about conventions for layout, and got no response. Thanks for the tips.

As this is meant to be a standalone binary and not a library, I was a little unsure about making it 'go get'-able vs a git checkout and an `. bash.envs` type distribution. For other go projects that are meant to be consumed as libraries, I have gone with a far more conventional layout.

Do you think it is worth while making the code 'go get'-able for development, given that above?
I imagine at some point I will add a binary as well, compiled on various systems for ease of use by people not interested in the codebase.

Thanks again for the feedback.

elij

unread,
Jul 29, 2012, 11:19:05 PM7/29/12
to Andrew Gerrand, golan...@googlegroups.com
Updated code layout based on feedback.

$ go get github.com/cactus/go-camo

Now works as expected.

Thanks.

Andrew Gerrand

unread,
Jul 29, 2012, 11:56:21 PM7/29/12
to elij, golan...@googlegroups.com
Great! Much cleaner.

I don't have the time to do a deep read of the code, but the general
structure of it looks good to me.
Reply all
Reply to author
Forward
0 new messages