~nbsp/cassini

c287d7cfb10aae119867e28c5e2a096c3bc10bf0 — Sol Fisher Romanoff 2 years ago 5499675
Remove ioutil dependency

as of Go 1.16, ioutil.ReadFile links to os.ReadFile, which I already
had imported.
1 files changed, 2 insertions(+), 3 deletions(-)

M main.go
M main.go => main.go +2 -3
@@ 5,7 5,6 @@ import (
	"crypto/tls"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"math/rand"
	"net/url"


@@ 157,7 156,7 @@ func serveRing(conn io.ReadWriteCloser, capsules [][]string) {
		// serve index page
		log.Println("serving index page")

		content, err := ioutil.ReadFile(argIndex)
		content, err := os.ReadFile(argIndex)
		if err != nil {
			log.Fatal("error while loading index file: ", err)
		}


@@ 188,7 187,7 @@ func response(conn io.ReadWriteCloser, code int, message string) {
// and their URLs, and returns a 2d string slice
func loadList() [][]string {
	// load file
	file, err := ioutil.ReadFile(argList)
	file, err := os.ReadFile(argList)
	if err != nil {
		log.Fatal("error while loading list: ", err)
	}