Skip to content
Go import redirector for GitHub Gists
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
app.go
app.yaml

README.md

go-gist

Ever see some tasty Go code in a GitHub Gist and want to try it out? What are you supposed to do, clone it into your own GitHub repo and go get it from there? Copy it locally? What are you? A farmer?

What you really want is to import "gist.github.com/UserName/11235813", but Gists don't support that. 😢

Which is why I made this simple app to solve a problem. Instead of import "gist.github.com/...", import "go-gist.appspot.com/...", and the site will tell the Go tool to go fetch the contents of the Gist.

It's all described in the docs. Those guys thought of everything.

Try it out:

go get go-gist.appspot.com/ImJasonH/7791518

or

go get go-gist.appspot.com/ImJasonH/7791518/readyset

Then:

import (
	//...
	readyset "go-gist.appspot.com/ImJasonH/7791518"
)

or

import (
	//...
	"go-gist.appspot.com/ImJasonH/7791518/readyset"
)

By the way, this would be totally unnecessary if the Gist HTML page was served with the necessary <meta> tag. If you work at GitHub or know someone who does, bug them to add a tag to their Gist HTML so I can turn this site off.


License

Copyright 2014 Jason Hall

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.