From 7848242795e568a7f0288bf335ba59d9846ce4b6 Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Sun, 20 Oct 2024 23:19:46 -0400 Subject: [PATCH] fix(go): remove unused code --- main.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/main.go b/main.go index a85a8dd..bdc50b9 100644 --- a/main.go +++ b/main.go @@ -39,27 +39,6 @@ func main() { return b.String() }) js.Global().Set("template", render) - - convertData := js.FuncOf(func(this js.Value, args []js.Value) interface{} { - if len(args) != 3 { - return "Must provide three arguments: inputData, fromFormat, toFormat" - } - inputData := args[0].String() - fromFmt := args[1].String() - toFmt := args[2].String() - - data, err := decode(inputData) - if err != nil { - return fmt.Sprintf("Error decoding from '%s': %v", fromFmt, err) - } - output, err := encode(data) - if err != nil { - return fmt.Sprintf("Error encoding to '%s': %v", toFmt, err) - } - return string(output) - }) - js.Global().Set("ExpConvertData", convertData) - // Wait forever <-make(chan bool) } @@ -70,7 +49,3 @@ func decode(inputData string) (data interface{}, err error) { } return } - -func encode(input interface{}) (output []byte, err error) { - return json.MarshalIndent(input, "", " ") -}