godoc/vfs: improve implementation of RootType

- Removed the StandAlone and Asset root types as they were just there
for other vfses to satisfy the FileSystem interface and causing unnecessary
confusion. Returning just empty strings in those scenarios now to clarify
that it is a dummy placeholder.

- Removed the prefix "Fs" from RootType as it was unnecessary.

- Using the RootType type to pass down to the html templates
instead of converting to string. The templates are capable of converting
to the actual string representation when comparing the value.

Change-Id: Iadc039f1354ecd814eec0af1e52cdbaaeff0cc89
Reviewed-on: https://go-review.googlesource.com/106196
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/godoc/dirtrees.go b/godoc/dirtrees.go
index a7de71a..e9483a0 100644
--- a/godoc/dirtrees.go
+++ b/godoc/dirtrees.go
@@ -26,13 +26,13 @@
 const testdataDirName = "testdata"
 
 type Directory struct {
-	Depth      int
-	Path       string       // directory path; includes Name
-	Name       string       // directory name
-	HasPkg     bool         // true if the directory contains at least one package
-	Synopsis   string       // package documentation, if any
-	FsRootType string       // string representation of vfs.RootType
-	Dirs       []*Directory // subdirectories
+	Depth    int
+	Path     string       // directory path; includes Name
+	Name     string       // directory name
+	HasPkg   bool         // true if the directory contains at least one package
+	Synopsis string       // package documentation, if any
+	RootType vfs.RootType // root type of the filesystem containing the directory
+	Dirs     []*Directory // subdirectories
 }
 
 func isGoFile(fi os.FileInfo) bool {
@@ -198,13 +198,13 @@
 	}
 
 	return &Directory{
-		Depth:      depth,
-		Path:       path,
-		Name:       name,
-		HasPkg:     hasPkgFiles && show, // TODO(bradfitz): add proper Hide field?
-		Synopsis:   synopsis,
-		FsRootType: string(b.c.fs.RootType(path)),
-		Dirs:       dirs,
+		Depth:    depth,
+		Path:     path,
+		Name:     name,
+		HasPkg:   hasPkgFiles && show, // TODO(bradfitz): add proper Hide field?
+		Synopsis: synopsis,
+		RootType: b.c.fs.RootType(path),
+		Dirs:     dirs,
 	}
 }
 
@@ -302,13 +302,13 @@
 // are useful for presenting an entry in an indented fashion.
 //
 type DirEntry struct {
-	Depth      int    // >= 0
-	Height     int    // = DirList.MaxHeight - Depth, > 0
-	Path       string // directory path; includes Name, relative to DirList root
-	Name       string // directory name
-	HasPkg     bool   // true if the directory contains at least one package
-	Synopsis   string // package documentation, if any
-	FsRootType string // string representation of vfs.RootType
+	Depth    int          // >= 0
+	Height   int          // = DirList.MaxHeight - Depth, > 0
+	Path     string       // directory path; includes Name, relative to DirList root
+	Name     string       // directory name
+	HasPkg   bool         // true if the directory contains at least one package
+	Synopsis string       // package documentation, if any
+	RootType vfs.RootType // root type of the filesystem containing the direntry
 }
 
 type DirList struct {
@@ -320,7 +320,7 @@
 // the standard library or not.
 func hasThirdParty(list []DirEntry) bool {
 	for _, entry := range list {
-		if entry.FsRootType == string(vfs.RootTypeGoPath) {
+		if entry.RootType == vfs.RootTypeGoPath {
 			return true
 		}
 	}
@@ -375,7 +375,7 @@
 		p.Name = d.Name
 		p.HasPkg = d.HasPkg
 		p.Synopsis = d.Synopsis
-		p.FsRootType = d.FsRootType
+		p.RootType = d.RootType
 		list = append(list, p)
 	}