()
| 88 | } |
| 89 | |
| 90 | func (s *Server) defaultBrowsePath() string { |
| 91 | roots := s.effectiveBrowseRoots() |
| 92 | if len(roots) > 0 { |
| 93 | return roots[0] |
| 94 | } |
| 95 | if home, err := os.UserHomeDir(); err == nil && strings.TrimSpace(home) != "" { |
| 96 | return home |
| 97 | } |
| 98 | if runtime.GOOS == "windows" { |
| 99 | return `C:\` |
| 100 | } |
| 101 | return string(filepath.Separator) |
| 102 | } |
| 103 | |
| 104 | func (s *Server) browseShortcuts() []directoryBrowseShortcut { |
| 105 | shortcuts := make([]directoryBrowseShortcut, 0, 8) |
no test coverage detected