Merge remote-tracking branch 'origin/master'

This commit is contained in:
Soren L. Hansen 2024-02-11 18:05:53 -08:00
commit 8dd044c7cf
4 changed files with 8 additions and 9 deletions

View File

@ -3,7 +3,7 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
"io/ioutil" "io"
"log" "log"
"os" "os"
"os/signal" "os/signal"
@ -68,7 +68,7 @@ func main() {
if appOptions.Quiet { if appOptions.Quiet {
log.SetFlags(0) log.SetFlags(0)
log.SetOutput(ioutil.Discard) log.SetOutput(io.Discard)
} }
if c.IsSet("credential") { if c.IsSet("credential") {

View File

@ -6,10 +6,10 @@ import (
"crypto/x509" "crypto/x509"
"html/template" "html/template"
"io/fs" "io/fs"
"io/ioutil"
"log" "log"
"net" "net"
"net/http" "net/http"
"os"
"regexp" "regexp"
"strings" "strings"
noesctmpl "text/template" noesctmpl "text/template"
@ -45,7 +45,7 @@ func New(factory Factory, options *Options) (*Server, error) {
} }
if options.IndexFile != "" { if options.IndexFile != "" {
path := homedir.Expand(options.IndexFile) path := homedir.Expand(options.IndexFile)
indexData, err = ioutil.ReadFile(path) indexData, err = os.ReadFile(path)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "failed to read custom index file at `%s`", path) return nil, errors.Wrapf(err, "failed to read custom index file at `%s`", path)
} }
@ -253,7 +253,7 @@ func (server *Server) setupHTTPServer(handler http.Handler) (*http.Server, error
func (server *Server) tlsConfig() (*tls.Config, error) { func (server *Server) tlsConfig() (*tls.Config, error) {
caFile := homedir.Expand(server.options.TLSCACrtFile) caFile := homedir.Expand(server.options.TLSCACrtFile)
caCert, err := ioutil.ReadFile(caFile) caCert, err := os.ReadFile(caFile)
if err != nil { if err != nil {
return nil, errors.New("could not open CA crt file " + caFile) return nil, errors.New("could not open CA crt file " + caFile)
} }

View File

@ -1,7 +1,7 @@
package server package server
import ( import (
"io/ioutil" "io"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -31,7 +31,7 @@ func (wsw *wsWrapper) Read(p []byte) (n int, err error) {
continue continue
} }
b, err := ioutil.ReadAll(reader) b, err := io.ReadAll(reader)
if len(b) > len(p) { if len(b) > len(p) {
return 0, errors.Wrapf(err, "Client message exceeded buffer size") return 0, errors.Wrapf(err, "Client message exceeded buffer size")
} }

View File

@ -1,7 +1,6 @@
package utils package utils
import ( import (
"io/ioutil"
"log" "log"
"os" "os"
"reflect" "reflect"
@ -114,7 +113,7 @@ func ApplyConfigFile(filePath string, options ...interface{}) error {
fileString := []byte{} fileString := []byte{}
log.Printf("Loading config file at: %s", filePath) log.Printf("Loading config file at: %s", filePath)
fileString, err := ioutil.ReadFile(filePath) fileString, err := os.ReadFile(filePath)
if err != nil { if err != nil {
return err return err
} }