Please use the URL package. This isn't a very nice way to do this. http://golang.org/pkg/net/url/#Parse