Skip to content

Commit e89f6dd

Browse files
[App Configuration] fix lint error and remove build tags for go 1.18 (#25683)
* fix lint error and remove build tags for go 1.18 * update * update coverage goal * add more tests * update
1 parent f92e9af commit e89f6dd

28 files changed

+392
-97
lines changed

sdk/data/azappconfig/client.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build go1.18
2-
// +build go1.18
3-
41
// Copyright (c) Microsoft Corporation. All rights reserved.
52
// Licensed under the MIT License. See License.txt in the project root for license information.
63

@@ -156,7 +153,7 @@ func (c *Client) GetSetting(ctx context.Context, key string, options *GetSetting
156153
return GetSettingResponse{
157154
Setting: settingFromGenerated(resp.KeyValue),
158155
SyncToken: SyncToken(*resp.SyncToken),
159-
LastModified: resp.KeyValue.LastModified,
156+
LastModified: resp.LastModified,
160157
}, nil
161158
}
162159

@@ -474,9 +471,9 @@ func (c *Client) GetSnapshot(ctx context.Context, snapshotName string, options *
474471
ETag: (*azcore.ETag)(getResp.Etag),
475472
Expires: getResp.Expires,
476473
ItemsCount: getResp.ItemsCount,
477-
Name: getResp.Snapshot.Name,
474+
Name: getResp.Name,
478475
Size: getResp.Size,
479-
Status: getResp.Snapshot.Status,
476+
Status: getResp.Status,
480477
},
481478
SyncToken: SyncToken(*getResp.SyncToken),
482479
Link: getResp.Link,
@@ -569,9 +566,9 @@ func (c *Client) updateSnapshotStatus(ctx context.Context, snapshotName string,
569566
ETag: (*azcore.ETag)(updateResp.Etag),
570567
Expires: updateResp.Expires,
571568
ItemsCount: updateResp.ItemsCount,
572-
Name: updateResp.Snapshot.Name,
569+
Name: updateResp.Name,
573570
Size: updateResp.Size,
574-
Status: updateResp.Snapshot.Status,
571+
Status: updateResp.Status,
575572
},
576573
SyncToken: SyncToken(*updateResp.SyncToken),
577574
Link: updateResp.Link,

sdk/data/azappconfig/client_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build go1.18
2-
// +build go1.18
3-
41
// Copyright (c) Microsoft Corporation. All rights reserved.
52
// Licensed under the MIT License.
63

@@ -548,7 +545,7 @@ func TestSnapshotArchive(t *testing.T) {
548545
// Archive the snapshot
549546
archiveSnapshot, err := client.ArchiveSnapshot(context.Background(), snapshotName, nil)
550547
require.NoError(t, err)
551-
require.Equal(t, azappconfig.SnapshotStatusArchived, *archiveSnapshot.Snapshot.Status)
548+
require.Equal(t, azappconfig.SnapshotStatusArchived, *archiveSnapshot.Status)
552549

553550
// Best effort snapshot cleanup
554551
require.NoError(t, CleanupSnapshot(client, snapshotName))
@@ -571,12 +568,12 @@ func TestSnapshotRecover(t *testing.T) {
571568
// Check that snapshot is archived
572569
archivedSnapshot, err := client.GetSnapshot(context.Background(), *snapshot.Name, nil)
573570
require.NoError(t, err)
574-
require.Equal(t, azappconfig.SnapshotStatusArchived, *archivedSnapshot.Snapshot.Status)
571+
require.Equal(t, azappconfig.SnapshotStatusArchived, *archivedSnapshot.Status)
575572

576573
// Recover the snapshot
577574
readySnapshot, err := client.RecoverSnapshot(context.Background(), *snapshot.Name, nil)
578575
require.NoError(t, err)
579-
require.Equal(t, azappconfig.SnapshotStatusReady, *readySnapshot.Snapshot.Status)
576+
require.Equal(t, azappconfig.SnapshotStatusReady, *readySnapshot.Status)
580577

581578
// Best effort snapshot cleanup
582579
require.NoError(t, CleanupSnapshot(client, snapshotName))

sdk/data/azappconfig/constants.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build go1.18
2-
// +build go1.18
3-
41
// Copyright (c) Microsoft Corporation. All rights reserved.
52
// Licensed under the MIT License. See License.txt in the project root for license information.
63

sdk/data/azappconfig/doc.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build go1.18
2-
// +build go1.18
3-
41
// Copyright (c) Microsoft Corporation. All rights reserved.
52
// Licensed under the MIT License. See License.txt in the project root for license information.
63

sdk/data/azappconfig/examples_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build go1.18
2-
// +build go1.18
3-
41
// Copyright (c) Microsoft Corporation. All rights reserved.
52
// Licensed under the MIT License. See License.txt in the project root for license information.
63

sdk/data/azappconfig/internal/auth/policy_hmac_auth.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build go1.18
2-
// +build go1.18
3-
41
// Copyright (c) Microsoft Corporation. All rights reserved.
52
// Licensed under the MIT License. See License.txt in the project root for license information.
63

0 commit comments

Comments
 (0)