func New(fileLocation, sectionName string) (*File, error) {
	if fileLocation == "" {
		fileLocation = "/etc/hosts"
	}
	hostF, err := os.Open(fileLocation)
	if err != nil {
		return nil, err
	}
	defer hostF.Close()
	info, err := hostF.Stat()
	if err != nil {
		return nil, err
	}
	b, err := io.ReadAll(hostF)
	if err != nil {
		return nil, err
	}
	f := NewWithContents(sectionName, b)
	f.fileLocation = fileLocation
	f.fileInfo = info
	return f, nil
}
New parses a hosts file and managed a block inside of the
hosts file.
package hostsfile
import (
	"bufio"
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net"
	"os"
	"sort"
	"strings"
	"sync"
	"time"
	"github.com/asaskevich/govalidator"
	"github.com/benbjohnson/clock"
	"github.com/pkg/errors"
)
type File struct {
	clock clock.Clock
	fileLocation string
	fileInfo     os.FileInfo
	contents  []byte
	blockName string
	lock     sync.Mutex
	saveLock sync.Mutex
	hostsFile map[string]*HostLine
}
type Metadata struct {
	BlockName    string    `json:"blockName"`
	LastModified time.Time `json:"last_modified_at"`
}
type HostLine struct {
	Addresses []string
}
func NewWithContents(sectionName string, contents []byte) *File {
	if sectionName == "" {
		sectionName = "localizer"
	}
	return &File{
		clock:     clock.New(),
		contents:  contents,
		blockName: sectionName,
		hostsFile: make(map[string]*HostLine),
	}
}