From f1794123376210fca037a1078d3b526fe2b683b6 Mon Sep 17 00:00:00 2001 From: Kendall Weihe Date: Tue, 19 Mar 2024 16:43:37 -0700 Subject: [PATCH] Adjust function declaration --- dids/diddht/diddht.go | 2 +- dids/diddht/diddht_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dids/diddht/diddht.go b/dids/diddht/diddht.go index 9f54e89..f892695 100644 --- a/dids/diddht/diddht.go +++ b/dids/diddht/diddht.go @@ -63,7 +63,7 @@ type verificationMethodOption struct { // Service is used to add a service to the DID being created with the [Create] function. // Note: Service can be passed to [Create] multiple times to add multiple services. -func Service(id string, svcType string, endpoint []string) CreateOption { +func Service(id string, svcType string, endpoint ...string) CreateOption { return func(o *createOptions) { // ensure that id follows relative DID URL requirements defined in did core spec: // https://www.w3.org/TR/did-core/#relative-did-urls diff --git a/dids/diddht/diddht_test.go b/dids/diddht/diddht_test.go index 62be29d..70db529 100644 --- a/dids/diddht/diddht_test.go +++ b/dids/diddht/diddht_test.go @@ -254,7 +254,7 @@ func Test_Create(t *testing.T) { var opts []CreateOption opts = []CreateOption{Gateway(relay.URL, http.DefaultClient), KeyManager(keyMgr)} for _, service := range didDoc.Service { - opts = append(opts, Service(service.ID, service.Type, service.ServiceEndpoint)) + opts = append(opts, Service(service.ID, service.Type, service.ServiceEndpoint...)) } for _, key := range test.keys { opts = append(opts, PrivateKey(key.algorithmID, key.purposes...))