From 937c683da0f1967bb6e6f89340c07010c28ab830 Mon Sep 17 00:00:00 2001 From: "kare.nuorteva" Date: Mon, 12 Dec 2016 00:16:16 +0000 Subject: [PATCH] Remove pointer from Server.Domain git-svn-id: file:///srv/svn/repo/toyohime/trunk@30 922d331f-388e-da47-97a9-ad700dc0b8b9 --- vanity.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vanity.go b/vanity.go index c40f39f..6f5fe0b 100644 --- a/vanity.go +++ b/vanity.go @@ -22,7 +22,7 @@ type ( // Server is the actual HTTP server for Go vanity domains. Server struct { // Domain is the vanity domain. - Domain *string + Domain string // Config contains settings for vanity packages. Config map[Path]Package } @@ -41,7 +41,7 @@ func NewPackage(path, vcssystem, vcsurl string) *Package { // NewServer returns a new Vanity Server given domain name and vanity package configuration. func NewServer(domain string, config map[Path]Package) *Server { s := &Server{ - Domain: &domain, + Domain: domain, Config: config, } return s @@ -77,9 +77,9 @@ func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } if r.FormValue("go-get") != "1" { - url := pack.GoDocURL(*s.Domain, r.URL.Path) + url := pack.GoDocURL(s.Domain, r.URL.Path) http.Redirect(w, r, url, http.StatusTemporaryRedirect) return } - fmt.Fprint(w, pack.GoImportMeta(*s.Domain)) + fmt.Fprint(w, pack.GoImportMeta(s.Domain)) }