Skip to content

Commit

Permalink
fix(go): remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
acouvreur committed Oct 21, 2024
1 parent 7bcd232 commit 7848242
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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, "", " ")
}

0 comments on commit 7848242

Please sign in to comment.