Removed resources.go
`resources.go` is no more! All glyphs, and Lang files have been extracted to the assets folder. A complete rework of `glyphbanner.go` is begining. - resources.go -> DELETED
This commit is contained in:
18
lang.go
18
lang.go
@@ -3,7 +3,6 @@ package nmslib
|
||||
import (
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
@@ -161,22 +160,7 @@ func toNMS(t Translate, csvlines [][]string) string {
|
||||
}
|
||||
|
||||
func openCSV(lagcsv string) [][]string {
|
||||
// create temp dir
|
||||
tempdir, err := ioutil.TempDir("", "nmslib-")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer os.RemoveAll(tempdir) // Clean up temp files
|
||||
|
||||
// extract language file from resources.go
|
||||
data, err := Asset(lagcsv)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// wirte extracted data to temp dir
|
||||
err = ioutil.WriteFile(tempdir+"/"+lagcsv, []byte(data), 0644)
|
||||
csvFile, err := os.Open(tempdir + "/" + lagcsv)
|
||||
csvFile, err := os.Open("./assets/lang/" + lagcsv)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user