Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenisanerd committed Feb 12, 2024
2 parents 4b7715e + 546ac8d commit 8dd044c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"io"
"log"
"os"
"os/signal"
Expand Down Expand Up @@ -68,7 +68,7 @@ func main() {

if appOptions.Quiet {
log.SetFlags(0)
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
}

if c.IsSet("credential") {
Expand Down
6 changes: 3 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"crypto/x509"
"html/template"
"io/fs"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"regexp"
"strings"
noesctmpl "text/template"
Expand Down Expand Up @@ -45,7 +45,7 @@ func New(factory Factory, options *Options) (*Server, error) {
}
if options.IndexFile != "" {
path := homedir.Expand(options.IndexFile)
indexData, err = ioutil.ReadFile(path)
indexData, err = os.ReadFile(path)
if err != nil {
return nil, errors.Wrapf(err, "failed to read custom index file at `%s`", path)
}
Expand Down Expand Up @@ -253,7 +253,7 @@ func (server *Server) setupHTTPServer(handler http.Handler) (*http.Server, error

func (server *Server) tlsConfig() (*tls.Config, error) {
caFile := homedir.Expand(server.options.TLSCACrtFile)
caCert, err := ioutil.ReadFile(caFile)
caCert, err := os.ReadFile(caFile)
if err != nil {
return nil, errors.New("could not open CA crt file " + caFile)
}
Expand Down
4 changes: 2 additions & 2 deletions server/ws_wrapper.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package server

import (
"io/ioutil"
"io"

"github.com/gorilla/websocket"
"github.com/pkg/errors"
Expand Down Expand Up @@ -31,7 +31,7 @@ func (wsw *wsWrapper) Read(p []byte) (n int, err error) {
continue
}

b, err := ioutil.ReadAll(reader)
b, err := io.ReadAll(reader)
if len(b) > len(p) {
return 0, errors.Wrapf(err, "Client message exceeded buffer size")
}
Expand Down
3 changes: 1 addition & 2 deletions utils/flags.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package utils

import (
"io/ioutil"
"log"
"os"
"reflect"
Expand Down Expand Up @@ -114,7 +113,7 @@ func ApplyConfigFile(filePath string, options ...interface{}) error {

fileString := []byte{}
log.Printf("Loading config file at: %s", filePath)
fileString, err := ioutil.ReadFile(filePath)
fileString, err := os.ReadFile(filePath)
if err != nil {
return err
}
Expand Down

0 comments on commit 8dd044c

Please sign in to comment.