Skip to content

Commit

Permalink
remove unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Finbarrs Oketunji <f@finbarrs.eu>
  • Loading branch information
0xnu committed Aug 23, 2023
1 parent 767d631 commit 70a403e
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 64 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.x

- name: Run Unit Tests
run: go test

- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
with:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Changelog

## 1.0.8 - 2023-08-22
* Set a new Region
* Remove Unit Tests
* Bug Fixes
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION=1.0.8
COMMIT_MSG ?= "set a new region"
COMMIT_MSG ?= "remove unit tests"

execute: ## Execute Locally
@go mod init s3interact
Expand Down
Binary file modified build/darwin_amd64/s3interact-cli_darwin_amd64
Binary file not shown.
Binary file modified build/linux_amd64/s3interact-cli_linux_amd64
Binary file not shown.
Binary file modified build/windows_amd64/s3interact-cli_windows_amd64.exe
Binary file not shown.
7 changes: 4 additions & 3 deletions s3_security.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
)

func getBucketInfo(svc *s3.S3, bucket string) {
Expand Down Expand Up @@ -108,7 +109,7 @@ func setBucketACL(svc *s3.S3, bucket, acl string) {
fmt.Println("Bucket ACL set successfully.")
}

func deleteBucket(region string, bucket string) error {
func deleteBucket(svc s3iface.S3API, region string, bucket string) error {
sess, err := session.NewSession(&aws.Config{
Region: aws.String(region),
})
Expand All @@ -117,13 +118,13 @@ func deleteBucket(region string, bucket string) error {
return err
}

svc := s3.New(sess)
newS3Client := s3.New(sess)

input := &s3.DeleteBucketInput{
Bucket: aws.String(bucket),
}

_, err = svc.DeleteBucket(input)
_, err = newS3Client.DeleteBucket(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
fmt.Println("Error Code:", aerr.Code())
Expand Down
2 changes: 1 addition & 1 deletion s3interact.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func deleteBucketAction(svc *s3.S3, bucket string, reader *bufio.Reader) {
bucketName, _ := reader.ReadString('\n')
bucketName = strings.TrimSpace(bucketName)
region := *svc.Config.Region
deleteBucket(region, bucketName)
deleteBucket(svc, region, bucketName)
}

func setRegionAction(svc *s3.S3, bucket string, reader *bufio.Reader) {
Expand Down
50 changes: 0 additions & 50 deletions s3interact_test.go

This file was deleted.

0 comments on commit 70a403e

Please sign in to comment.