Skip to content

Commit

Permalink
Merge pull request #44 from pratikkumar-mohite/pm/issue-35
Browse files Browse the repository at this point in the history
Issue 35: Moved the cmd to main package
  • Loading branch information
pratikkumar-mohite authored Aug 31, 2024
2 parents 0a968a9 + 474da4d commit c1cc0b9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 21 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
fi
- name: Create and push new tag
run: |
new_tag=${{ steps.update_latest_tag.outputs.new_tag }}
git tag -a $new_tag -m "Release $new_tag"
git push origin $new_tag
# - name: Create and push new tag
# run: |
# new_tag=${{ steps.update_latest_tag.outputs.new_tag }}
# git tag -a $new_tag -m "Release $new_tag"
# git push origin $new_tag
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ build: bench
@CGO_ENABLED=0 go build -pgo=cpu.out -ldflags="-w -s" -v -o s3-cleanup ./cmd/s3-cleanup/

run:
@CGO_ENABLED=0 go run main.go
@CGO_ENABLED=0 go run ./cmd/s3-cleanup/

test:
@go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -v --timeout=10m
@go test -v -timeout 20m -covermode=atomic -coverprofile=coverage.txt ./...

bench:
@go test -v -bench=. -count=6 -cpuprofile=cpu.out -memprofile=mem.out . -run=^Benchmark$ > benchmark.txt
@go test -v -bench=. -count=6 -cpuprofile=cpu.out -memprofile=mem.out ./cmd/s3-cleanup/ -run=^Benchmark$ > benchmark.txt

bench-heavy:
@go test -v -bench=. -count=10 -cpu=1,2,4,8 -cpuprofile=cpu.out -memprofile=mem.out . -run=^Benchmark$ > benchmark.txt
@go test -v -bench=. -count=10 -cpu=1,2,4,8 -cpuprofile=cpu.out -memprofile=mem.out ./cmd/s3-cleanup/ -run=^Benchmark$ > benchmark.txt
@benchstat benchmark.txt
@echo top | go tool pprof mem.out
@echo top | go tool pprof cpu.out
Expand Down
4 changes: 2 additions & 2 deletions cmd/s3-cleanup/cleanup.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package main

import (
"fmt"
Expand All @@ -15,7 +15,7 @@ func setup() aws.S3Client {
return client
}

func S3Cleanup() {
func s3Cleanup() {
s3Client := setup()
object1 := s3Client.UploadS3BucketObjects("test/files/file1.txt")
s3Client.UploadS3BucketObjects("test/files/file2.txt")
Expand Down
5 changes: 5 additions & 0 deletions cmd/s3-cleanup/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func main() {
s3Cleanup()
}
2 changes: 1 addition & 1 deletion cmd/s3-cleanup/utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package main

import (
"fmt"
Expand Down
9 changes: 0 additions & 9 deletions main.go

This file was deleted.

0 comments on commit c1cc0b9

Please sign in to comment.