func bufferedReadFile(filename string) (string, error) {
	fr, err := os.Open(filename)
	if err != nil {
		log.Println(err)
		return "", err
	}
	defer fr.Close()
	var buf bytes.Buffer
	buf.ReadFrom(fr)
	return buf.String(), nil
}
bufferedReadFile read the given file using bytes.Buffer
package pathtraversal
import (
	"bytes"
	"fmt"
	"html/template"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"os"
	"strings"
	"github.com/Contrast-Security-OSS/go-test-bench/utils"
)
func pathTTemplate(w http.ResponseWriter, r *http.Request, data utils.Parameters) (template.HTML, bool) {
	return "pathTraversal.gohtml", true
}
func readFileHandler(w http.ResponseWriter, r *http.Request, method string, inputs string, isBuffered bool) (template.HTML, bool) {
	log.Printf("Executing pathTraversal readFile ; method = %s ; use of bytes.Buffer = %t\n", method, isBuffered)
	var data string
	var err error
	switch method {
	case "safe":
		inputs = url.QueryEscape(inputs)
		if isBuffered {
			data, err = bufferedReadFile(inputs)
		} else {
			data, err = readFile(inputs)
		}
		if err != nil {
			return template.HTML("Congrats, you are safe! Error from readFile: " + err.Error()), false
		} else if data == "" {
			return template.HTML("Congrats, you are safe! No data was read."), false
		}
	case "unsafe":
		if isBuffered {
			data, err = bufferedReadFile(inputs)
		} else {
			data, err = readFile(inputs)
		}
	default:
		data = "INVALID URL"
	}
	return template.HTML(data), false
}