Skip to content

Commit b6b2578

Browse files
committed
fix array being encoded as null in json
1 parent e9813f1 commit b6b2578

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

presenters/json_presenter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package presenters
22

33
import (
44
"encoding/json"
5+
"io"
6+
57
"github.com/pivotal-cf/om/api"
68
"github.com/pivotal-cf/om/models"
7-
"io"
89
)
910

1011
type JSONPresenter struct {
@@ -116,10 +117,9 @@ func (j JSONPresenter) PresentLicensedProducts(products []api.ExpiringLicenseOut
116117
ProductVersion string `json:"product_version"`
117118
LicenseVersion string `json:"licensed_version"`
118119
}
119-
var output []licenseOutput
120+
output := []licenseOutput{}
120121
var expiresAt string
121122
for _, product := range products {
122-
123123
if product.ExpiresAt.IsZero() {
124124
expiresAt = ""
125125
} else {

0 commit comments

Comments
 (0)