--- a/colornameconv.go +++ b/colornameconv.go @@ -5,11 +5,7 @@ "errors" "fmt" "github.com/crazy3lf/colorconv" - "io" "math" - "os" - "path" - "runtime" "strings" ) @@ -74,21 +70,9 @@ } func readJson() Colors { - _, filename, _, ok := runtime.Caller(0) - if !ok { - panic("No caller information") - } - in, err := os.Open(path.Dir(filename) + "/colors.json") - - if err != nil { - panic(fmt.Sprintf("Failed to read JSON file: %s", err)) - } - - byteValue, _ := io.ReadAll(in) - var colors Colors - err = json.Unmarshal(byteValue, &colors) + err := json.Unmarshal(colorsJSON, &colors) if err != nil { panic(fmt.Sprintf("Failed to unmarshal JSON: %s", err))