Formatting cleanup for return values
This commit is contained in:
parent
7780b8eaa9
commit
d2368884b7
|
@ -460,6 +460,7 @@ func scanPath(path string, files *Files, filters *Filters, stats *ScanStats, con
|
||||||
go func() {
|
go func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
<-concurrency.fileScans
|
<-concurrency.fileScans
|
||||||
|
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -523,6 +524,7 @@ func fileList(paths []string, filters *Filters, sort string, index *Index) ([]st
|
||||||
go func(i int) {
|
go func(i int) {
|
||||||
defer func() {
|
defer func() {
|
||||||
<-concurrency.directoryScans
|
<-concurrency.directoryScans
|
||||||
|
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -325,6 +325,7 @@ func (s *ServeStats) GetMostServed() string {
|
||||||
for _, v := range stats.List {
|
for _, v := range stats.List {
|
||||||
if retVal == "" {
|
if retVal == "" {
|
||||||
retVal = v
|
retVal = v
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -603,7 +604,9 @@ func serveCacheClear(args []string, index *Index) httprouter.Handle {
|
||||||
index.generateCache(args)
|
index.generateCache(args)
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/plain")
|
w.Header().Set("Content-Type", "text/plain")
|
||||||
|
|
||||||
w.Write([]byte("Ok"))
|
w.Write([]byte("Ok"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -629,6 +632,7 @@ func serveStats(args []string, stats *ServeStats) httprouter.Handle {
|
||||||
response, err := stats.ListImages()
|
response, err := stats.ListImages()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,12 +739,14 @@ func serveStaticFile(paths []string, stats *ServeStats) httprouter.Handle {
|
||||||
prefixedFilePath, err := stripQueryParams(path)
|
prefixedFilePath, err := stripQueryParams(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
filePath, err := filepath.EvalSymlinks(strings.TrimPrefix(prefixedFilePath, SourcePrefix))
|
filePath, err := filepath.EvalSymlinks(strings.TrimPrefix(prefixedFilePath, SourcePrefix))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -753,6 +759,7 @@ func serveStaticFile(paths []string, stats *ServeStats) httprouter.Handle {
|
||||||
exists, err := fileExists(filePath)
|
exists, err := fileExists(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -767,6 +774,7 @@ func serveStaticFile(paths []string, stats *ServeStats) httprouter.Handle {
|
||||||
buf, err := os.ReadFile(filePath)
|
buf, err := os.ReadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue