Skip to content

Commit 45eb61c

Browse files
committed
minor styling
1 parent 0fbc67f commit 45eb61c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎imaginary.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func checkMountDirectory(path string) {
246246
if err != nil {
247247
exitWithError("error while mounting directory: %s", err)
248248
}
249-
if src.IsDir() == false {
249+
if !src.IsDir() {
250250
exitWithError("mount path is not a directory: %s", path)
251251
}
252252
if path == "/" {
@@ -255,7 +255,7 @@ func checkMountDirectory(path string) {
255255
}
256256

257257
func checkHTTPCacheTTL(ttl int) {
258-
if ttl < -1 || ttl > 31556926 {
258+
if ttl < 0 || ttl > 31556926 {
259259
exitWithError("The -http-cache-ttl flag only accepts a value from 0 to 31556926")
260260
}
261261

@@ -265,7 +265,7 @@ func checkHTTPCacheTTL(ttl int) {
265265
}
266266

267267
func parseOrigins(origins string) []*url.URL {
268-
urls := []*url.URL{}
268+
var urls []*url.URL
269269
if origins == "" {
270270
return urls
271271
}
@@ -280,7 +280,7 @@ func parseOrigins(origins string) []*url.URL {
280280
}
281281

282282
func parseEndpoints(input string) Endpoints {
283-
endpoints := Endpoints{}
283+
var endpoints Endpoints
284284
for _, endpoint := range strings.Split(input, ",") {
285285
endpoint = strings.ToLower(strings.TrimSpace(endpoint))
286286
if endpoint != "" {
@@ -301,7 +301,7 @@ func memoryRelease(interval int) {
301301
}
302302

303303
func exitWithError(format string, args ...interface{}) {
304-
fmt.Fprintf(os.Stderr, format+"\n", args)
304+
_, _ = fmt.Fprintf(os.Stderr, format+"\n", args)
305305
os.Exit(1)
306306
}
307307

0 commit comments

Comments
 (0)
⌂ 换网址