1
1
Fork 0
mirror of https://tildegit.org/solderpunk/molly-brown synced 2024-05-09 20:16:02 +02:00

Big ol' gofmt.

This commit is contained in:
Solderpunk 2023-02-10 17:19:21 +01:00
parent 56d8dde14a
commit 5258b29c6b
4 changed files with 43 additions and 43 deletions

View File

@ -2,11 +2,11 @@ package main
import (
"errors"
"github.com/BurntSushi/toml"
"log"
"os"
"path/filepath"
"strings"
"github.com/BurntSushi/toml"
)
type Config struct {
@ -93,7 +93,7 @@ func getConfig(filename string) (Config, error) {
}
// Absolutise DocBase
if(!filepath.IsAbs(config.DocBase)) {
if !filepath.IsAbs(config.DocBase) {
abs, err := filepath.Abs(config.DocBase)
if err != nil {
return config, err
@ -103,7 +103,7 @@ func getConfig(filename string) (Config, error) {
// Absolutise CGI paths
for index, cgiPath := range config.CGIPaths {
if(!filepath.IsAbs(cgiPath)) {
if !filepath.IsAbs(cgiPath) {
config.CGIPaths[index] = filepath.Join(config.DocBase, cgiPath)
}
}
@ -121,7 +121,7 @@ func getConfig(filename string) (Config, error) {
// Absolutise SCGI paths
for index, scgiPath := range config.SCGIPaths {
if(!filepath.IsAbs(scgiPath)) {
if !filepath.IsAbs(scgiPath) {
config.SCGIPaths[index] = filepath.Join(config.DocBase, scgiPath)
}
}

View File

@ -51,7 +51,7 @@ func generateDirectoryListing(URL *url.URL, path string, config Config) (string,
return false // Should not happen
})
// Sort directories before file
if(config.DirectorySubdirsFirst) {
if config.DirectorySubdirsFirst {
sort.SliceStable(files, func(i, j int) bool {
// If i is a dir and j is a file, i < j
if files[i].IsDir() && !files[j].IsDir() {