go
go copied to clipboard
Allow path after a shortcut: go/short/foobar
This allows adding additional path to a shortened URL. For example, if go/short redirects to http://example.com, go/short/foobar will redirect to http://example.com/foobar.
An example usage is to shorten Google Docs headings. go/mydoc can redirect to a document. go/mydoc/#heading=h.asdfgh123456 can then redirect to a specific heading in the doc.
This feature is supported in the original golinks at Google.
Next step: Create a chrome extension that links to the go/ server and shortens a given link based on the shortcuts already registered
shouldn't we have a special placeholder defined in the route, instead of simply appending ?
I get that appending cover most cases but I wonder...
there is a compilation error in api.go, need to update the 3 calls to parseName
GOPATH=`pwd` go get github.com/deepanshu-zendrive/go
# github.com/kellegous/go/web
src/github.com/kellegous/go/web/api.go:78:4: assignment mismatch: 1 variable but parseName returns 2 values
src/github.com/kellegous/go/web/api.go:128:4: assignment mismatch: 1 variable but parseName returns 2 values
src/github.com/kellegous/go/web/api.go:148:4: assignment mismatch: 1 variable but parseName returns 2 values