fix(http): do not send null for empty arrays (#1134)

This commit is contained in:
ze0s 2023-09-22 18:35:27 +02:00 committed by GitHub
parent 8694b04876
commit 664e5413b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -87,7 +87,8 @@ func (r *IndexerRepo) List(ctx context.Context) ([]domain.Indexer, error) {
defer rows.Close()
var indexers []domain.Indexer
indexers := make([]domain.Indexer, 0)
for rows.Next() {
var f domain.Indexer

View file

@ -408,7 +408,7 @@ func (s *service) ListNetworks(ctx context.Context) ([]domain.IrcNetwork, error)
return nil, err
}
var ret []domain.IrcNetwork
ret := make([]domain.IrcNetwork, 0)
for _, n := range networks {
channels, err := s.repo.ListChannels(n.ID)
@ -431,7 +431,7 @@ func (s *service) GetNetworksWithHealth(ctx context.Context) ([]domain.IrcNetwor
return nil, err
}
var ret []domain.IrcNetworkWithHealth
ret := make([]domain.IrcNetworkWithHealth, 0)
for _, n := range networks {
netw := domain.IrcNetworkWithHealth{