Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zyclonite committed Jan 4, 2024
1 parent 4256e3c commit 60619f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 6 additions & 10 deletions aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func NewAWS(p *Plugin) AWS {

c := s3.New(sess)
cf := cloudfront.New(sess)
r := make([]string, 1, 1)
l := make([]string, 1, 1)
r := make([]string, 1)
l := make([]string, 1)

return AWS{c, cf, r, l, p}
}
Expand All @@ -69,7 +69,7 @@ func (a *AWS) Upload(local, remote string) error {

var access string
for pattern := range p.Access {
if match := glob.Glob(pattern, local); match == true {
if match := glob.Glob(pattern, local); match {
access = p.Access[pattern]
break
}
Expand Down Expand Up @@ -103,15 +103,15 @@ func (a *AWS) Upload(local, remote string) error {

var cacheControl string
for pattern := range p.CacheControl {
if match := glob.Glob(pattern, local); match == true {
if match := glob.Glob(pattern, local); match {
cacheControl = p.CacheControl[pattern]
break
}
}

metadata := map[string]*string{}
for pattern := range p.Metadata {
if match := glob.Glob(pattern, local); match == true {
if match := glob.Glob(pattern, local); match {
for k, v := range p.Metadata[pattern] {
metadata[k] = aws.String(v)
}
Expand Down Expand Up @@ -228,10 +228,6 @@ func (a *AWS) Upload(local, remote string) error {
} else if *g.Permission == "WRITE" {
previousAccess = "public-read-write"
}
} else if *gt.URI == "http://acs.amazonaws.com/groups/global/AllUsers" {
if *g.Permission == "READ" {
previousAccess = "authenticated-read"
}
}
}
}
Expand Down Expand Up @@ -341,7 +337,7 @@ func (a *AWS) Delete(remote string) error {

func (a *AWS) List(path string) ([]string, error) {
p := a.plugin
remote := make([]string, 1, 1)
remote := make([]string, 1)
resp, err := a.client.ListObjects(&s3.ListObjectsInput{
Bucket: aws.String(p.Bucket),
Prefix: aws.String(path),
Expand Down
4 changes: 2 additions & 2 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (p *Plugin) Exec() error {
os.Exit(1)
}

p.jobs = make([]job, 1, 1)
p.jobs = make([]job, 1)
p.client = NewAWS(p)

p.createSyncJobs()
Expand Down Expand Up @@ -82,7 +82,7 @@ func (p *Plugin) createSyncJobs() {
os.Exit(1)
}

local := make([]string, 1, 1)
local := make([]string, 1)

err = filepath.Walk(p.Source, func(path string, info os.FileInfo, err error) error {
if err != nil || info.IsDir() {
Expand Down

0 comments on commit 60619f3

Please sign in to comment.