export types PrivateHost and PublicWeb

golint specifically advises: "exported func NewPublicWeb returns unexported
type public_server.publicWeb, which can be annoying to use"
This commit is contained in:
Andrew Siegman 2017-10-22 17:13:44 -05:00
parent 86454f35d3
commit 03c97bfdfe
2 changed files with 8 additions and 8 deletions

View file

@ -10,19 +10,19 @@ import (
"github.com/Ennovar/gPanel/general/routing"
)
type privateHost struct {
type PrivateHost struct {
Auth int
Directory string
}
func NewPrivateHost() privateHost {
return privateHost{
func NewPrivateHost() PrivateHost {
return PrivateHost{
Auth: 1,
Directory: "private/",
}
}
func (priv *privateHost) ServeHTTP(w http.ResponseWriter, req *http.Request) {
func (priv *PrivateHost) ServeHTTP(w http.ResponseWriter, req *http.Request) {
path := req.URL.Path[1:]
path = (priv.Directory + path)

View file

@ -10,17 +10,17 @@ import (
"github.com/Ennovar/gPanel/general/routing"
)
type publicWeb struct {
type PublicWeb struct {
Directory string
}
func NewPublicWeb() publicWeb {
return publicWeb{
func NewPublicWeb() PublicWeb {
return PublicWeb{
Directory: "public/",
}
}
func (pub *publicWeb) ServeHTTP(w http.ResponseWriter, req *http.Request) {
func (pub *PublicWeb) ServeHTTP(w http.ResponseWriter, req *http.Request) {
path := req.URL.Path[1:]
path = (pub.Directory + path)