Skip to content

Commit

Permalink
lint: enable unused and fix problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Apr 12, 2024
1 parent 1703edf commit baba384
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ linters:
#- staticcheck
- gosimple
- stylecheck
#- unused
- unused
- misspell
#- prealloc
#- maligned
Expand Down
21 changes: 0 additions & 21 deletions awscli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,6 @@ func (tc *testCLI) run(method string, subcommand string, args ...string) {
tc.OK(err)
}

func (tc *testCLI) output(method string, subcommand string, args ...string) (out []byte) {
tc.Helper()
out, err := tc.command(method, subcommand, args...).Output()
if _, ok := err.(*exec.Error); ok {
tc.Skip("aws cli not found on $PATH")
}
if err != nil {
tc.Log(string(out))
}
tc.OK(err)
return out
}

func (tc *testCLI) combinedOutput(method string, subcommand string, args ...string) (out []byte) {
tc.Helper()
out, err := tc.command(method, subcommand, args...).CombinedOutput()
Expand Down Expand Up @@ -284,14 +271,6 @@ func (tc *testCLI) fileArg(bucket string, file string) string {
return fmt.Sprintf("s3://%s", path.Join(bucket, file))
}

func (tc *testCLI) fileArgs(bucket string, files ...string) []string {
out := make([]string, len(files))
for i, f := range files {
out[i] = tc.fileArg(bucket, f)
}
return out
}

type cliTime time.Time

func (c cliTime) contentTime() gofakes3.ContentTime {
Expand Down
11 changes: 0 additions & 11 deletions init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ type testServerOption func(ts *testServer)
func withoutInitialBuckets() testServerOption {
return func(ts *testServer) { ts.initialBuckets = nil }
}
func withInitialBuckets(buckets ...string) testServerOption {
return func(ts *testServer) { ts.initialBuckets = buckets }
}
func withVersioning() testServerOption {
return func(ts *testServer) { ts.versioning = true }
}
Expand Down Expand Up @@ -791,14 +788,6 @@ func prefixFile(prefix string) *gofakes3.Prefix {
return &gofakes3.Prefix{Delimiter: "/", Prefix: prefix}
}

func prefix(prefix string) *gofakes3.Prefix {
return &gofakes3.Prefix{Prefix: prefix}
}

func prefixDelim(prefix string, delim string) *gofakes3.Prefix {
return &gofakes3.Prefix{Prefix: prefix, Delimiter: delim}
}

func strs(s ...string) []string {
return s
}
Expand Down
11 changes: 4 additions & 7 deletions s3mem/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (

type versionGenFunc func() gofakes3.VersionID

type versioningStatus int

type bucket struct {
name string
versioning gofakes3.VersioningStatus
Expand Down Expand Up @@ -51,11 +49,10 @@ func (b *bucketObject) Iterator() *bucketObjectIterator {
}

type bucketObjectIterator struct {
data *bucketData
iter skiplist.Iterator
cur *bucketData
seenData bool
done bool
data *bucketData
iter skiplist.Iterator
cur *bucketData
done bool
}

func (b *bucketObjectIterator) Seek(key gofakes3.VersionID) bool {
Expand Down
6 changes: 0 additions & 6 deletions validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,3 @@ func ValidateBucketName(name string) error {

return nil
}

var etagPattern = regexp.MustCompile(`^"[a-z0-9]+"$`)

func validETag(v string) bool {
return etagPattern.MatchString(v)
}
2 changes: 0 additions & 2 deletions xml/marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type Ship struct {
Drive DriveType `xml:"drive"`
Age uint `xml:"age"`
Passenger []*Passenger `xml:"passenger"`
secret string
}

type NamedType string
Expand Down Expand Up @@ -155,7 +154,6 @@ type EmbedC struct {
}

type embedD struct {
fieldD string
FieldE string // Promoted and visible when embedD is embedded.
}

Expand Down

0 comments on commit baba384

Please sign in to comment.