~adnano/astronaut

c2cbc6b7e5ba6ccdb1e473261a134a4e897e6d46 — Adnan Maolood 3 months ago 1c28b6e
settings: Remove unused code
1 files changed, 0 insertions(+), 20 deletions(-)

M settings.go
M settings.go => settings.go +0 -20
@@ 5,14 5,11 @@ import (
	"io"
	"os"
	"sync"

	"git.sr.ht/~adnano/go-gemini"
)

type Settings struct {
	sync.RWMutex
	path    string
	mux     gemini.Mux
	Display struct {
		Graphics bool `json:"graphics"`
		AltText  bool `json:"alt-text"`


@@ 43,20 40,3 @@ func (s *Settings) Load(path string) error {
	}
	return nil
}

// Save writes the settings to disk.
func (s *Settings) Save() error {
	f, err := os.OpenFile(s.path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
	if err != nil {
		return err
	}
	b, err := json.MarshalIndent(s, "", "\t")
	if err != nil {
		return err
	}
	_, err = f.Write(b)
	if err != nil {
		return err
	}
	return nil
}