From aae6356138d697c45450bf65e2163ecd1be4822b Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 3 Jun 2020 13:26:09 +0200 Subject: [PATCH] Fix formatting --- pkg/proto/v0/settings.pb.micro_test.go | 18 +++++++++--------- pkg/service/v0/service.go | 1 + pkg/service/v0/validator.go | 5 ++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/proto/v0/settings.pb.micro_test.go b/pkg/proto/v0/settings.pb.micro_test.go index 8be2c5591..0acc3d473 100644 --- a/pkg/proto/v0/settings.pb.micro_test.go +++ b/pkg/proto/v0/settings.pb.micro_test.go @@ -789,7 +789,7 @@ func TestListMultipleSettingsBundlesOfSameExtension(t *testing.T) { BundleKey: "alices-bundle", }, DisplayName: "Alice's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err := cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -802,7 +802,7 @@ func TestListMultipleSettingsBundlesOfSameExtension(t *testing.T) { BundleKey: "bobs-bundle", }, DisplayName: "Bob's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err = cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -815,7 +815,7 @@ func TestListMultipleSettingsBundlesOfSameExtension(t *testing.T) { BundleKey: "bobs-bundle", }, DisplayName: "Bob's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err = cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -845,7 +845,7 @@ func TestListAllSettingsBundlesOfSameExtension(t *testing.T) { BundleKey: "alices-bundle", }, DisplayName: "Alice's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err := cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -858,7 +858,7 @@ func TestListAllSettingsBundlesOfSameExtension(t *testing.T) { BundleKey: "bobs-bundle", }, DisplayName: "Bob's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err = cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -871,7 +871,7 @@ func TestListAllSettingsBundlesOfSameExtension(t *testing.T) { BundleKey: "bobs-bundle", }, DisplayName: "Bob's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err = cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -916,7 +916,7 @@ func TestListSettingsBundlesInFoldersThatAreNotAccessible(t *testing.T) { BundleKey: "alices-bundle", }, DisplayName: "Alice's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err := cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -929,7 +929,7 @@ func TestListSettingsBundlesInFoldersThatAreNotAccessible(t *testing.T) { BundleKey: "bobs-bundle", }, DisplayName: "Bob's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err = cl.SaveSettingsBundle(context.Background(), &createRequest) @@ -942,7 +942,7 @@ func TestListSettingsBundlesInFoldersThatAreNotAccessible(t *testing.T) { BundleKey: "bobs-bundle", }, DisplayName: "Bob's Bundle", - Settings: dummySettings, + Settings: dummySettings, }, } _, err = cl.SaveSettingsBundle(context.Background(), &createRequest) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 631d784fe..b126efe0e 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -2,6 +2,7 @@ package svc import ( "context" + "github.com/owncloud/ocis-pkg/v2/middleware" "github.com/owncloud/ocis-settings/pkg/config" "github.com/owncloud/ocis-settings/pkg/proto/v0" diff --git a/pkg/service/v0/validator.go b/pkg/service/v0/validator.go index a618474cc..5eb96b6ac 100644 --- a/pkg/service/v0/validator.go +++ b/pkg/service/v0/validator.go @@ -9,8 +9,8 @@ import ( ) var ( - regexForKeys = regexp.MustCompile("^[A-Za-z0-9\\-_]*$") - keyRule = []validation.Rule{ + regexForKeys = regexp.MustCompile(`^[A-Za-z0-9\-_]*$`) + keyRule = []validation.Rule{ validation.Required, validation.Match(regexForKeys), } @@ -83,4 +83,3 @@ func validateValueIdentifier(identifier *proto.Identifier) error { validation.Field(&identifier.AccountUuid, accountUUIDRule...), ) } -