gofmt
This commit is contained in:
@ -249,14 +249,14 @@ func (s *Server) viewHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data := struct {
|
data := struct {
|
||||||
Hostname string
|
Hostname string
|
||||||
WebAddress string
|
WebAddress string
|
||||||
GAKey string
|
GAKey string
|
||||||
UserVoiceKey string
|
UserVoiceKey string
|
||||||
PurgeTime string
|
PurgeTime string
|
||||||
MaxUploadSize string
|
MaxUploadSize string
|
||||||
SampleToken string
|
SampleToken string
|
||||||
SampleToken2 string
|
SampleToken2 string
|
||||||
}{
|
}{
|
||||||
hostname,
|
hostname,
|
||||||
webAddress,
|
webAddress,
|
||||||
@ -1043,7 +1043,7 @@ func (s *Server) getHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
reader = ioutil.NopCloser(bluemonday.UGCPolicy().SanitizeReader(reader))
|
reader = ioutil.NopCloser(bluemonday.UGCPolicy().SanitizeReader(reader))
|
||||||
}
|
}
|
||||||
|
|
||||||
if w.Header().Get("Range") != "" || strings.HasPrefix(metadata.ContentType, "video") || strings.HasPrefix(metadata.ContentType, "audio") {
|
if w.Header().Get("Range") != "" || strings.HasPrefix(metadata.ContentType, "video") || strings.HasPrefix(metadata.ContentType, "audio") {
|
||||||
file, err := ioutil.TempFile(s.tempPath, "range-")
|
file, err := ioutil.TempFile(s.tempPath, "range-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.Printf("%s", err.Error())
|
s.logger.Printf("%s", err.Error())
|
||||||
|
@ -258,9 +258,9 @@ func acceptsHTML(hdr http.Header) bool {
|
|||||||
|
|
||||||
func formatSize(size int64) string {
|
func formatSize(size int64) string {
|
||||||
sizeFloat := float64(size)
|
sizeFloat := float64(size)
|
||||||
base := math.Log(sizeFloat)/math.Log(1024)
|
base := math.Log(sizeFloat) / math.Log(1024)
|
||||||
|
|
||||||
sizeOn := math.Pow(1024, base - math.Floor(base))
|
sizeOn := math.Pow(1024, base-math.Floor(base))
|
||||||
|
|
||||||
var round float64
|
var round float64
|
||||||
pow := math.Pow(10, float64(2))
|
pow := math.Pow(10, float64(2))
|
||||||
@ -276,7 +276,6 @@ func formatSize(size int64) string {
|
|||||||
suffixes[3] = "GB"
|
suffixes[3] = "GB"
|
||||||
suffixes[4] = "TB"
|
suffixes[4] = "TB"
|
||||||
|
|
||||||
|
|
||||||
getSuffix := suffixes[int(math.Floor(base))]
|
getSuffix := suffixes[int(math.Floor(base))]
|
||||||
return fmt.Sprintf("%s %s", strconv.FormatFloat(newVal, 'f', -1, 64), getSuffix)
|
return fmt.Sprintf("%s %s", strconv.FormatFloat(newVal, 'f', -1, 64), getSuffix)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user