Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Jun 27, 2024
1 parent 2947f58 commit 41d920d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/connection/prepared_stmt_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ type jsonDoubleValueStruct struct {
value float64
}

// MarshalJSON ensures that the double value is always formatted with a decimal point
// even if it's an integer. This is necessary because Exasol expects a decimal point
// for double values.
// See https://github.com/exasol/exasol-driver-go/issues/108 for details.
func (j *jsonDoubleValueStruct) MarshalJSON() ([]byte, error) {
r, err := json.Marshal(j.value)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/connection/prepared_stmt_converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func TestConvertArgs(t *testing.T) {
t.Errorf("Error converting arg: %v", err)
return
}

actualJson, err := json.Marshal(converted)
if err != nil {
t.Errorf("Error marshalling converted arg '%v' of type %T: %v", converted, converted, err)
Expand Down

0 comments on commit 41d920d

Please sign in to comment.