aboutsummaryrefslogtreecommitdiff
path: root/langs
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-04-26 19:56:36 -0400
committerXe Iaso <me@xeiaso.net>2025-04-26 19:56:36 -0400
commitcc70fd1fc49ec08a8dba80508626cc42ac24cc26 (patch)
tree2cffa4d44cd7b36d107871418aff20e330a33d24 /langs
parentb02d2ba479446de6f38fce1e25cec8564ef9010a (diff)
downloadx-cc70fd1fc49ec08a8dba80508626cc42ac24cc26.tar.xz
x-cc70fd1fc49ec08a8dba80508626cc42ac24cc26.zip
chore: run go mod generate
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'langs')
-rw-r--r--langs/tokipona/internal/bindata.go233
-rw-r--r--langs/tokipona/internal/generate.go3
-rw-r--r--langs/tokipona/nimi.go8
-rw-r--r--langs/tokipona/tokipona.json (renamed from langs/tokipona/internal/data/tokipona.json)0
4 files changed, 5 insertions, 239 deletions
diff --git a/langs/tokipona/internal/bindata.go b/langs/tokipona/internal/bindata.go
deleted file mode 100644
index b30b404..0000000
--- a/langs/tokipona/internal/bindata.go
+++ /dev/null
@@ -1,233 +0,0 @@
-// Code generated by go-bindata. DO NOT EDIT.
-// sources:
-// data/tokipona.json
-package internal
-
-import (
- "bytes"
- "compress/gzip"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
- "time"
-)
-
-func bindataRead(data []byte, name string) ([]byte, error) {
- gz, err := gzip.NewReader(bytes.NewBuffer(data))
- if err != nil {
- return nil, fmt.Errorf("Read %q: %v", name, err)
- }
-
- var buf bytes.Buffer
- _, err = io.Copy(&buf, gz)
- clErr := gz.Close()
-
- if err != nil {
- return nil, fmt.Errorf("Read %q: %v", name, err)
- }
- if clErr != nil {
- return nil, err
- }
-
- return buf.Bytes(), nil
-}
-
-type asset struct {
- bytes []byte
- info os.FileInfo
-}
-
-type bindataFileInfo struct {
- name string
- size int64
- mode os.FileMode
- modTime time.Time
-}
-
-func (fi bindataFileInfo) Name() string {
- return fi.name
-}
-func (fi bindataFileInfo) Size() int64 {
- return fi.size
-}
-func (fi bindataFileInfo) Mode() os.FileMode {
- return fi.mode
-}
-func (fi bindataFileInfo) ModTime() time.Time {
- return fi.modTime
-}
-func (fi bindataFileInfo) IsDir() bool {
- return false
-}
-func (fi bindataFileInfo) Sys() interface{} {
- return nil
-}
-
-var _tokiponaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x5a\xbd\x72\x23\x37\x0c\xee\xfd\x14\x7b\xaa\x3d\x71\x7f\x4d\xea\x3c\xc3\xcd\x15\xd0\x0a\xd2\x42\x4b\x12\x3c\xfe\x78\xed\x64\xf2\xee\x19\x2b\x8e\x2d\x85\x10\x48\x6a\xe5\x52\x6b\x0f\x00\x82\xc0\x87\x0f\x00\x7f\x3c\x0c\xc3\x5f\x0f\xc3\x30\x0c\x1b\x07\x16\x37\xdf\x87\x0d\x6c\x1e\xff\xfd\x70\x30\x1c\xe3\xe9\xcb\xf4\xf1\x29\x80\xb5\x10\x36\xdf\x87\x1f\xa7\x0f\xc3\xb0\x21\x97\x30\x1c\x37\xa7\x9f\x3f\x1f\x86\xe1\xef\x47\x41\xe4\x8c\x91\xfe\x93\x31\x42\xc2\x03\x87\xd7\xd3\x1f\x1c\x59\x30\x85\xc2\x80\x3e\x91\x41\x45\xab\xab\x28\x34\xe5\x29\x1c\x2b\xf2\x2c\xef\xde\xff\x7a\x12\xfe\xd8\x75\x3a\x43\xa5\xcb\x8c\x51\xad\x7f\x3c\x57\x5c\x91\x8e\x5f\x29\xdd\xf9\xd2\x53\xd9\xed\x30\xdc\x4d\x41\x2a\xed\xdf\xd1\x7e\x8f\x01\x5d\x6a\x57\xf2\xf1\x63\x64\x77\xfc\xfc\xf5\x9c\x6a\xea\xb3\x14\x77\x11\x3d\x04\x48\x1c\x0a\xd3\x58\x3b\xf8\x49\xb7\xae\x6f\x41\x27\x84\xb3\x05\x72\x8a\xdc\x67\xba\x38\x51\xbb\x77\xb1\xf3\x70\xdb\x23\x8e\x69\xb0\x10\x66\xf5\x82\x23\xfa\x8a\x5e\xd7\xa7\x18\xdc\x6e\x95\x5b\x31\xe6\xd2\xad\x71\x62\x7f\x3b\x44\xd0\x91\x0b\x89\x69\x22\x77\xb8\x21\x26\x6b\x51\x48\x73\x99\x03\xf8\x4c\x5a\x12\x5f\xc8\x7f\x47\x21\x09\xa0\xce\xc3\xe5\x99\x2a\x66\x18\xe1\xc8\xcc\x3a\x96\xe8\x12\x5d\x2c\xe1\x83\x5c\xa4\x9d\x0e\xde\xed\x11\x7e\x84\xb9\x44\xd7\x1d\x85\xf4\x7a\x03\x9a\x9f\x3b\xab\x05\xd9\x8f\x20\xc6\xf9\x95\xaa\xe5\x31\x44\xd6\xd2\xfc\xd6\xf0\x39\xe2\xe7\xc5\x9d\xdb\x31\xb2\x11\x72\xed\x15\x8d\xe1\xa5\xe2\x1d\x5d\x5f\x19\x26\x13\x3c\x6b\x37\x7a\xee\xd8\x4a\xc8\xcc\x67\xb5\xb9\xc1\xa9\x7b\x8a\x1a\xfb\x68\x50\x66\xcb\x08\x8d\x9c\x55\x40\x72\x17\x39\xd5\x7c\x4f\xb3\xa4\x6b\x64\xab\x7a\x8e\xc4\x48\xed\x8a\x8f\x19\x62\x99\x23\xde\x40\xa5\xbe\xea\x32\x85\x3a\xe6\x39\x46\xda\xaa\xbc\xec\xca\x71\xaa\x27\x40\x8f\x92\xc6\x1c\x5b\xa3\xce\x87\x5a\xcd\x9a\x49\xe0\x69\xfb\x90\x69\x8d\x97\xa8\xb4\x19\x4c\xac\x31\xcd\x8a\x4c\x91\x43\xf0\x38\xb7\x23\x9e\xae\xa0\x4c\xef\xf8\x2b\x53\x9c\x34\x48\xad\xca\x14\xea\x33\xe7\x7b\xd1\xd4\x39\x0b\x2c\xf8\x12\xfe\xee\x07\xb7\x73\x36\xd9\xe7\x42\xdd\x21\x70\xd6\xf9\x46\xcf\x79\x04\x56\x6c\x28\x26\x54\x69\x62\x0f\x35\x94\x51\xf6\x3a\x45\x23\x37\x8c\xec\x12\xbe\x68\xe9\x50\x25\x86\x06\x7c\x79\xb0\x80\xb1\x91\xe9\x9f\xc3\x47\xc3\x09\x63\x47\x59\xdc\x9a\x8c\x4f\x87\x80\xaa\x87\x1b\x74\x2e\x25\xc4\x4f\x08\x8d\xd5\xa4\x2b\x0e\x8d\x00\x03\xa3\xe1\xb4\xa2\x1e\x1a\x14\xe2\x6e\x64\xf3\x25\xe6\x8b\x1d\xbf\x12\x80\x71\x55\xe0\x49\xe8\x1e\xad\xde\x29\x77\x9e\xc7\x1d\x05\x2a\x91\x42\xad\x67\xa8\x48\x15\xa0\xc6\x83\xaf\x34\xe0\xba\x4c\x3e\x8a\x8d\xa1\x9c\x18\x01\xb5\xdb\xaf\x67\x84\x80\xfc\x86\xdf\xd4\x6a\x62\x4f\xe5\xfa\x3c\xed\x75\x1d\x79\x16\xb2\x4e\x6f\x2a\x6b\x3e\xca\x52\xed\x8e\xd8\xca\x37\xfa\x90\x2a\x0b\x53\x96\x89\xd7\x4c\xb8\x04\xa6\x69\x56\x39\xc4\x9e\x91\xd7\x96\x66\x07\xfa\xe6\x37\x15\xdd\xae\x4c\x5e\xcb\x0e\x57\x30\x12\x8b\x32\x00\x5d\xeb\x33\xd0\x42\xe5\x3e\x3a\xce\x53\x9e\xe6\x8f\xa7\xe5\x7e\xd2\xe5\xf4\xbe\x72\xb2\x7b\x9e\x8b\xe7\x12\xac\xf6\xcc\xad\xbd\x54\x05\x61\x2d\x0b\x18\xbe\x43\xa8\x54\x3c\x31\x27\xbb\xb8\x92\x65\x27\x74\x50\x5b\x50\x29\x77\x97\xe3\x4a\xb7\x59\xe6\x6f\x8a\xf4\x96\xf1\x84\x15\x86\x62\x96\x7b\x46\x10\x15\xf1\x72\x5b\xa9\x27\xe5\x15\xb2\xd0\xd1\x46\x5b\x89\x1c\x5b\x70\x37\x4e\x7c\x54\x5d\x0e\x2c\x08\xfd\x10\xbe\xa4\x00\x77\x72\xa3\x13\x67\xec\x2e\xdb\xed\x9a\x1a\xef\x40\x98\xbc\x8d\x01\xfe\x6c\xf6\x52\xdd\x35\x51\xa8\x90\x16\x9c\x5b\x65\x37\xba\xd2\xee\x6d\xb6\x2b\x26\xb9\x42\xed\x48\x93\xca\x26\xeb\x77\x46\x02\x84\x9f\xfe\x78\xbb\x95\x2c\x70\x18\x83\x2b\xa8\x63\x19\xb6\x64\x3d\x06\x48\xa4\xce\xea\xe2\x39\xf3\x6a\x81\x19\x96\x12\xe4\x75\x85\x2b\xd8\x08\x81\x65\x58\xb5\xfa\xd6\x2e\x84\x85\x70\x9b\xf0\x29\x4e\xf8\x54\x19\xfc\xb4\x67\x38\x7b\xa1\x53\xbb\xf8\x28\x72\x49\x55\xa6\x87\x59\x5a\x62\xee\x30\xa6\xc0\x8d\x08\x7c\x8d\xaf\xb6\x5c\xba\x97\xb6\x9a\x16\xe6\x1b\xef\xa8\x99\xea\xbf\xe9\x15\x90\x2d\x54\x38\x46\x45\x66\x79\x3d\x87\xa0\xaf\xe4\xea\x22\x4b\x23\x0f\x7a\xe2\x75\x0c\xc9\x7d\x67\xef\xcc\xfb\x35\xbd\xb3\x27\x29\x21\xf7\x88\x8d\xe3\xbb\x9e\xe2\xee\xc9\xe2\x51\x6c\x34\xae\x8d\x6d\x74\x16\x76\x6b\xe1\xf7\x24\x94\x0d\x6c\xdd\x0a\x74\x41\x90\x27\xf9\x3a\xaf\xf0\x75\x72\x11\xc7\x15\x33\x69\x2f\x15\x9a\xbe\x8d\xdc\xc7\x8f\xfa\x54\xdd\xb3\xb0\x9f\xdb\xf2\xcb\x1a\xfb\xa5\xd4\x6a\x6e\x32\xd4\xc5\x69\xf5\xaa\x4a\x9e\x9e\x78\xa6\xc1\xb3\xa3\xd6\x19\xe6\xff\x79\xaf\xaa\x30\x8a\xeb\x29\xb2\x64\x40\x23\x59\x9d\x97\x14\x51\x00\xf3\x05\x82\xfd\x82\x68\x8f\x28\x6c\x99\x63\x0e\x7b\x18\x57\x50\x86\x88\xb6\xec\x09\x96\x09\xbe\xe4\x4e\x70\x11\x46\x89\xd9\x63\xa0\x9e\x7d\x83\xae\x83\x8e\x92\x9f\xb6\xbc\x5b\x31\xf2\x88\xd2\x3b\x83\x91\xc2\x78\xb7\x01\x80\xd4\x11\x38\xac\x2d\x9b\xdb\x63\x87\x84\xd4\x7f\xe5\x7c\x3f\xeb\xbd\x54\xe8\x02\xaf\xd9\x94\x46\x4a\x28\x8d\xea\x77\x01\x34\xc7\x74\xd4\xaa\x28\x21\xe2\x42\x71\xc7\x8d\x09\xdc\x43\xc0\x22\x2f\x7d\x93\x33\xfb\xa6\x79\xc5\x1b\x92\x98\x05\x70\xda\x92\xd6\x18\x5d\x65\x97\x55\x55\xae\xcc\x39\x43\x87\x69\xcd\xf5\x4b\xb3\xdd\x04\xfa\x9a\xbc\x2a\x53\x42\xa0\x05\xf1\x26\xb8\xab\x44\x57\x12\xd8\xf1\x16\x47\xd0\x77\xef\x97\x03\xfc\xca\x79\xd2\xd9\xa6\xee\x93\xb3\x3a\xd3\x3c\xab\xa8\xbf\x10\x4b\xd2\x62\xce\xea\x3d\x65\xb1\x84\x90\x88\x64\x9f\x2f\x25\x50\x37\xf4\x2b\xd3\x9d\x46\xa4\x09\x9d\x17\x1e\x71\xd1\x9a\xc9\x44\x92\x28\x5c\x02\x33\xdf\xfc\x18\x4e\xf4\x69\x4b\xd7\x99\xd8\x0a\x6f\x8f\x58\x0f\xc5\x9e\x12\x90\x04\x82\xb7\x74\x3c\x0c\x56\x85\x67\x69\xd0\x17\x51\xe7\xc2\x4d\x4e\xd4\xd5\x26\x29\xf2\x73\xeb\xd4\xbc\xea\xb3\x9c\xa4\x49\x04\xa4\xd4\x3c\x1f\xaf\x45\xf5\x02\x3d\x0f\xdc\x96\x89\x92\x16\x0f\x3d\x57\xb6\x08\xe0\xc7\xae\x43\x7a\xc7\x19\xe5\xd7\x0a\x57\xaa\xea\x96\xc2\x8a\x89\xc7\x22\xa1\xa1\xe7\xa5\xe7\x59\x77\xfb\xc9\x50\x68\x38\x61\x51\xf7\x04\x37\x7b\x91\x84\x87\x40\x0e\xd5\x5d\xf3\x25\x41\x68\x8f\xfb\xdf\xa4\xeb\xba\x3e\x83\x39\xf5\x07\x1f\x76\xa4\x57\xff\xde\x51\xba\x31\x65\x48\xa4\xae\x65\x4e\xff\xa5\x5b\xf3\x7b\x9f\x35\xbf\x32\xc6\x73\xa5\x77\xb7\xe7\x5b\x9f\x3d\xf8\x32\x1a\xb0\xf0\xa5\x26\x7d\xef\x33\xe9\x0d\x5d\xbe\xce\x98\xc7\x5e\x63\xec\xe7\x24\x60\x9d\x31\x0f\x3f\x1f\xfe\x09\x00\x00\xff\xff\xb5\xb4\x11\xe8\xd7\x33\x00\x00")
-
-func tokiponaJsonBytes() ([]byte, error) {
- return bindataRead(
- _tokiponaJson,
- "tokipona.json",
- )
-}
-
-func tokiponaJson() (*asset, error) {
- bytes, err := tokiponaJsonBytes()
- if err != nil {
- return nil, err
- }
-
- info := bindataFileInfo{name: "tokipona.json", size: 13271, mode: os.FileMode(420), modTime: time.Unix(1549128098, 0)}
- a := &asset{bytes: bytes, info: info}
- return a, nil
-}
-
-// Asset loads and returns the asset for the given name.
-// It returns an error if the asset could not be found or
-// could not be loaded.
-func Asset(name string) ([]byte, error) {
- cannonicalName := strings.Replace(name, "\\", "/", -1)
- if f, ok := _bindata[cannonicalName]; ok {
- a, err := f()
- if err != nil {
- return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
- }
- return a.bytes, nil
- }
- return nil, fmt.Errorf("Asset %s not found", name)
-}
-
-// MustAsset is like Asset but panics when Asset would return an error.
-// It simplifies safe initialization of global variables.
-func MustAsset(name string) []byte {
- a, err := Asset(name)
- if err != nil {
- panic("asset: Asset(" + name + "): " + err.Error())
- }
-
- return a
-}
-
-// AssetInfo loads and returns the asset info for the given name.
-// It returns an error if the asset could not be found or
-// could not be loaded.
-func AssetInfo(name string) (os.FileInfo, error) {
- cannonicalName := strings.Replace(name, "\\", "/", -1)
- if f, ok := _bindata[cannonicalName]; ok {
- a, err := f()
- if err != nil {
- return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
- }
- return a.info, nil
- }
- return nil, fmt.Errorf("AssetInfo %s not found", name)
-}
-
-// AssetNames returns the names of the assets.
-func AssetNames() []string {
- names := make([]string, 0, len(_bindata))
- for name := range _bindata {
- names = append(names, name)
- }
- return names
-}
-
-// _bindata is a table, holding each asset generator, mapped to its name.
-var _bindata = map[string]func() (*asset, error){
- "tokipona.json": tokiponaJson,
-}
-
-// AssetDir returns the file names below a certain
-// directory embedded in the file by go-bindata.
-// For example if you run go-bindata on data/... and data contains the
-// following hierarchy:
-// data/
-// foo.txt
-// img/
-// a.png
-// b.png
-// then AssetDir("data") would return []string{"foo.txt", "img"}
-// AssetDir("data/img") would return []string{"a.png", "b.png"}
-// AssetDir("foo.txt") and AssetDir("notexist") would return an error
-// AssetDir("") will return []string{"data"}.
-func AssetDir(name string) ([]string, error) {
- node := _bintree
- if len(name) != 0 {
- cannonicalName := strings.Replace(name, "\\", "/", -1)
- pathList := strings.Split(cannonicalName, "/")
- for _, p := range pathList {
- node = node.Children[p]
- if node == nil {
- return nil, fmt.Errorf("Asset %s not found", name)
- }
- }
- }
- if node.Func != nil {
- return nil, fmt.Errorf("Asset %s not found", name)
- }
- rv := make([]string, 0, len(node.Children))
- for childName := range node.Children {
- rv = append(rv, childName)
- }
- return rv, nil
-}
-
-type bintree struct {
- Func func() (*asset, error)
- Children map[string]*bintree
-}
-var _bintree = &bintree{nil, map[string]*bintree{
- "tokipona.json": &bintree{tokiponaJson, map[string]*bintree{}},
-}}
-
-// RestoreAsset restores an asset under the given directory
-func RestoreAsset(dir, name string) error {
- data, err := Asset(name)
- if err != nil {
- return err
- }
- info, err := AssetInfo(name)
- if err != nil {
- return err
- }
- err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
- if err != nil {
- return err
- }
- err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
- if err != nil {
- return err
- }
- err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
- if err != nil {
- return err
- }
- return nil
-}
-
-// RestoreAssets restores an asset under the given directory recursively
-func RestoreAssets(dir, name string) error {
- children, err := AssetDir(name)
- // File
- if err != nil {
- return RestoreAsset(dir, name)
- }
- // Dir
- for _, child := range children {
- err = RestoreAssets(dir, filepath.Join(name, child))
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-func _filePath(dir, name string) string {
- cannonicalName := strings.Replace(name, "\\", "/", -1)
- return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
-}
-
diff --git a/langs/tokipona/internal/generate.go b/langs/tokipona/internal/generate.go
deleted file mode 100644
index 8b57a5b..0000000
--- a/langs/tokipona/internal/generate.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package internal
-
-//go:generate go-bindata -prefix data/ -pkg internal data
diff --git a/langs/tokipona/nimi.go b/langs/tokipona/nimi.go
index 40c793d..eb79b0a 100644
--- a/langs/tokipona/nimi.go
+++ b/langs/tokipona/nimi.go
@@ -2,11 +2,13 @@ package tokipona
import (
"bytes"
+ "embed"
"encoding/json"
-
- "within.website/x/langs/tokipona/internal"
)
+//go:embed tokipona.json
+var static embed.FS
+
// Word is a single word in the Toki Pona dictionary.
type Word struct {
Name string `json:"name"`
@@ -18,7 +20,7 @@ type Word struct {
// LoadWords loads the embedded Toki Pona dictionary.
func LoadWords() ([]Word, error) {
- data, err := internal.Asset("tokipona.json")
+ data, err := static.ReadFile("tokipona.json")
fin := bytes.NewBuffer(data)
var result []Word
diff --git a/langs/tokipona/internal/data/tokipona.json b/langs/tokipona/tokipona.json
index 268fe30..268fe30 100644
--- a/langs/tokipona/internal/data/tokipona.json
+++ b/langs/tokipona/tokipona.json