@@ -14,9 +14,9 @@ import (
1414
1515// Convert converts an input_string from the input_format to the output_format.
1616// Returns the output string and error, if any.
17- func Convert (input_string string , input_format string , input_header []string , input_comment string , output_format string , verbose bool ) (string , error ) {
17+ func Convert (input_bytes [] byte , input_format string , input_header []string , input_comment string , input_limit int , output_format string , output_limit int , verbose bool ) (string , error ) {
1818
19- input_type , err := GetType (input_string , input_format )
19+ input_type , err := GetType (input_bytes , input_format )
2020 if err != nil {
2121 return "" , errors .Wrap (err , "error creating new object for format " + input_format )
2222 }
@@ -29,7 +29,7 @@ func Convert(input_string string, input_format string, input_header []string, in
2929
3030 if input_format == "bson" || input_format == "json" || input_format == "hcl" || input_format == "hcl2" || input_format == "properties" || input_format == "toml" || input_format == "yaml" {
3131 if output_format == "bson" || output_format == "json" || input_format == "hcl" || input_format == "hcl2" || output_format == "properties" || output_format == "toml" || output_format == "yaml" {
32- object , err := Deserialize (input_string , input_format , input_header , input_comment , input_type , verbose )
32+ object , err := Deserialize (string ( input_bytes ) , input_format , input_header , input_comment , input_limit , input_type , verbose )
3333 if err != nil {
3434 return "" , errors .Wrap (err , "Error deserializing input" )
3535 }
@@ -42,7 +42,7 @@ func Convert(input_string string, input_format string, input_header []string, in
4242 }
4343 return output_string , nil
4444 } else if output_format == "jsonl" {
45- object , err := Deserialize (input_string , input_format , input_header , input_comment , input_type , verbose )
45+ object , err := Deserialize (string ( input_bytes ) , input_format , input_header , input_comment , input_limit , input_type , verbose )
4646 if err != nil {
4747 return "" , errors .Wrap (err , "Error deserializing input" )
4848 }
@@ -60,7 +60,7 @@ func Convert(input_string string, input_format string, input_header []string, in
6060 }
6161 } else if input_format == "jsonl" || input_format == "csv" || input_format == "tsv" {
6262 if output_format == "bson" || output_format == "json" || output_format == "hcl" || output_format == "hcl2" || output_format == "toml" || output_format == "yaml" || output_format == "jsonl" || output_format == "csv" || output_format == "tsv" {
63- object , err := Deserialize (input_string , input_format , input_header , input_comment , input_type , verbose )
63+ object , err := Deserialize (string ( input_bytes ) , input_format , input_header , input_comment , input_limit , input_type , verbose )
6464 if err != nil {
6565 return "" , errors .Wrap (err , "Error deserializing input" )
6666 }
0 commit comments