From ca68e2e383e0aa00a7bc16cd92a2953e7c4f32a6 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Tue, 13 Feb 2024 23:10:19 +0800 Subject: [PATCH] fix: return empty list when no branch exists --- internal/provider/branch_data_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/branch_data_source.go b/internal/provider/branch_data_source.go index dda56cb..92a8be7 100644 --- a/internal/provider/branch_data_source.go +++ b/internal/provider/branch_data_source.go @@ -116,7 +116,7 @@ func (d *BranchDataSource) Read(ctx context.Context, req datasource.ReadRequest, return } - var branches []BranchDataSourceModel + branches := make([]BranchDataSourceModel, 0) for _, branch := range *httpResp.JSON200 { if branch.IsDefault { continue