Skip to content

Commit

Permalink
Fix errcheck lint
Browse files Browse the repository at this point in the history
Errors must be prefixed with `err`
  • Loading branch information
Sean-Der committed Jan 7, 2025
1 parent 000d319 commit 3d2f2f9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package main

import (
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/http"
"os"
"path"
"path/filepath"
"regexp"
"strings"
"time"

"crypto/tls"
"log"
"net/http"

"github.com/glimesh/broadcast-box/internal/networktest"
"github.com/glimesh/broadcast-box/internal/webrtc"
"github.com/joho/godotenv"
Expand All @@ -30,7 +29,7 @@ const (
networkTestFailedMessage = "\033[0;31mNetwork Test failed.\n%s\nPlease see the README and join Discord for help\033[0m"
)

var noBuildDirectoryErr = errors.New("\033[0;31mBuild directory does not exist, run `npm install` and `npm run build` in the web directory.\033[0m")
var errNoBuildDirectoryErr = errors.New("\033[0;31mBuild directory does not exist, run `npm install` and `npm run build` in the web directory.\033[0m")

type (
whepLayerRequestJSON struct {
Expand Down Expand Up @@ -207,7 +206,7 @@ func main() {
}

if _, err := os.Stat("./web/build"); os.IsNotExist(err) && os.Getenv("DISABLE_FRONTEND") == "" {
return noBuildDirectoryErr
return errNoBuildDirectoryErr
}

return nil
Expand Down Expand Up @@ -265,7 +264,6 @@ func main() {
log.Println("Running HTTP->HTTPS redirect Server at :" + httpsRedirectPort)
log.Fatal(redirectServer.ListenAndServe())
}()

}

mux := http.NewServeMux()
Expand Down Expand Up @@ -307,5 +305,4 @@ func main() {
log.Println("Running HTTP Server at `" + os.Getenv("HTTP_ADDRESS") + "`")
log.Fatal(server.ListenAndServe())
}

}

0 comments on commit 3d2f2f9

Please sign in to comment.