Skip to content

Commit

Permalink
Merge pull request #110 from go-gandi/nameserver-array
Browse files Browse the repository at this point in the history
domain: allocate the nameservers array
  • Loading branch information
nlewo authored Apr 7, 2022
2 parents 3b49cb9 + bbfa6b6 commit 50f6a14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions gandi/structures_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func expandContact(in interface{}) *domain.Contact {
}

func expandNameServers(ns []interface{}) (ret []string) {
// We need to allocate at least 0 element. Otherwise, the
// empty list is json encoded to null instead of [].
// See https://apoorvam.github.io/blog/2017/golang-json-marshal-slice-as-empty-array-not-null/
ret = make([]string, 0)
for _, v := range ns {
ret = append(ret, v.(string))
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/fatih/color v1.9.0 // indirect
github.com/go-gandi/go-gandi v0.2.0
github.com/go-gandi/go-gandi v0.3.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1
github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect
github.com/oklog/run v1.1.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-gandi/go-gandi v0.2.0 h1:r3eEiR5ABDh/5xRKorKLsNBUS1t2ffUPI+S0YozsVmM=
github.com/go-gandi/go-gandi v0.2.0/go.mod h1:9NoYyfWCjFosClPiWjkbbRK5UViaZ4ctpT8/pKSSFlw=
github.com/go-gandi/go-gandi v0.3.0 h1:57hWAcN5QiMXcFFF3iV09s4Ny7RGQoMPaHVmstHwx58=
github.com/go-gandi/go-gandi v0.3.0/go.mod h1:9NoYyfWCjFosClPiWjkbbRK5UViaZ4ctpT8/pKSSFlw=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
Expand Down

0 comments on commit 50f6a14

Please sign in to comment.