|
25 | 25 | Compressable = []string{"", ".txt", ".htm", ".html", ".css", ".toml", ".php", ".js", ".json", ".md", ".mdown", ".xml", ".svg", ".go", ".cgi", ".py", ".pl", ".aspx", ".asp"}
|
26 | 26 | // RandomDictionary - String of Characters used in Etag generation, change in needed
|
27 | 27 | RandomDictionary = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
28 |
| - Platform = runtime.GOOS |
| 28 | + platform = runtime.GOOS |
29 | 29 | slash = getCorrectSlash()
|
30 | 30 | fslash = []byte("/")[0]
|
31 | 31 | )
|
@@ -129,7 +129,7 @@ func (mfi *MemFileInstance) Update() {
|
129 | 129 | return err
|
130 | 130 | } else {
|
131 | 131 | if mfi.DevMode {
|
132 |
| - fmt.Println("New file Found: ", servePath) |
| 132 | + fmt.Println("New file Found: ", servePath, " from ", location) |
133 | 133 | }
|
134 | 134 | return check(mfi.CacheFile(location, servePath), false)
|
135 | 135 | }
|
@@ -186,7 +186,7 @@ func (mfi *MemFileInstance) CacheFile(location string, servePath string) error {
|
186 | 186 | mfi.Cached.Store(servePath, memFile)
|
187 | 187 | }
|
188 | 188 |
|
189 |
| - // mutating things causes trouble when loads of ther stuff is accessing |
| 189 | + // mutating things causes trouble when loads of stuff is accessing |
190 | 190 | // the MemFile so I'm locking it down while a file is being updated
|
191 | 191 | memFile.mutex.Lock()
|
192 | 192 |
|
@@ -239,7 +239,7 @@ func ServablePath(dir string, loc string) string {
|
239 | 239 | if loc[:1] != slash {
|
240 | 240 | loc = slash + loc
|
241 | 241 | }
|
242 |
| - if Platform == "windows" { |
| 242 | + if platform == "windows" { |
243 | 243 | loc = strings.Replace(loc, "\\", "/", -1)
|
244 | 244 | }
|
245 | 245 | return loc
|
@@ -342,7 +342,7 @@ func ServeMemFile(res http.ResponseWriter, req *http.Request, memFile *MemFile,
|
342 | 342 | }
|
343 | 343 |
|
344 | 344 | func getCorrectSlash() string {
|
345 |
| - if Platform == "windows" { |
| 345 | + if platform == "windows" { |
346 | 346 | return "\\"
|
347 | 347 | }
|
348 | 348 | return "/"
|
|
0 commit comments