From c068b1571a2c287bc308177925b9d2078424f482 Mon Sep 17 00:00:00 2001 From: rishav-karanjit Date: Thu, 28 Aug 2025 16:09:23 -0700 Subject: [PATCH 1/2] auto commit --- AwsEncryptionSDK/runtimes/go/examples/main.go | 3 +++ .../runtimes/go/examples/utils/exampleUtils.go | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/AwsEncryptionSDK/runtimes/go/examples/main.go b/AwsEncryptionSDK/runtimes/go/examples/main.go index b58ec215b..2ced64bed 100644 --- a/AwsEncryptionSDK/runtimes/go/examples/main.go +++ b/AwsEncryptionSDK/runtimes/go/examples/main.go @@ -165,4 +165,7 @@ func main() { utils.GenerateUUIDTestData(numOfString), utils.DefaultKMSKeyId(), utils.DefaultKmsKeyRegion()) + + // cleanup + utils.CleanUpFiles() } diff --git a/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go b/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go index 0c02b1148..576965fbe 100644 --- a/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go +++ b/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go @@ -157,6 +157,14 @@ func KeyStoreName() string { // Utility functions +func CleanUpFiles() { + os.Remove(eccPrivateKeyFileNameSender) + os.Remove(eccPrivateKeyFileNameRecipient) + os.Remove(eccPublicKeyFileNameRecipient) + os.Remove(kmsEccPublicKeyFileNameRecipient) + os.Remove(kmsEccPublicKeyFileNameSender) +} + func WriteRawEcdhEccKeys(ecdhCurveSpec awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) error { // Safety check: Validate neither file is present if FileExists(eccPrivateKeyFileNameSender) || From 10e6e10deb2f7b67fd3a82f0cccdcdbf11b35f3c Mon Sep 17 00:00:00 2001 From: rishav-karanjit Date: Thu, 28 Aug 2025 16:12:59 -0700 Subject: [PATCH 2/2] auto commit --- .../runtimes/go/examples/utils/exampleUtils.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go b/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go index 576965fbe..7eb685f33 100644 --- a/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go +++ b/AwsEncryptionSDK/runtimes/go/examples/utils/exampleUtils.go @@ -53,6 +53,14 @@ twIDAQAB testKmsEcdhKeyIdP256RecipientKeyId = "arn:aws:kms:us-west-2:370957321024:key/0265c8e9-5b6a-4055-8f70-63719e09fda5" ) +var filesCreatedByExamples = []string{ + eccPrivateKeyFileNameSender, + eccPrivateKeyFileNameRecipient, + eccPublicKeyFileNameRecipient, + kmsEccPublicKeyFileNameRecipient, + kmsEccPublicKeyFileNameSender, +} + // Getter functions func KmsEcdhKeyIdP256SenderKeyId() string { @@ -158,11 +166,9 @@ func KeyStoreName() string { // Utility functions func CleanUpFiles() { - os.Remove(eccPrivateKeyFileNameSender) - os.Remove(eccPrivateKeyFileNameRecipient) - os.Remove(eccPublicKeyFileNameRecipient) - os.Remove(kmsEccPublicKeyFileNameRecipient) - os.Remove(kmsEccPublicKeyFileNameSender) + for _, file := range filesCreatedByExamples { + os.Remove(file) + } } func WriteRawEcdhEccKeys(ecdhCurveSpec awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) error {